Change version php for domain

djcart

Verified User
Joined
Jun 29, 2021
Messages
125
Hi, I'm using cloudlinux and openlitespeed. I wanted to be able to set a separate php version for a given domain. I tried to add "AddHandler application / x-httpd-php80 php - for PHP 8.0" to htaccess but it didn't help. I reset litespeed and that doesn't help either.
 
There is still a problem instructions from this page: https://docs.cloudlinux.com/cloudlinux_os_components/#litespeed- support,

I am using Openlitespeed. Along with the Directadmin environment it is read-only via the GUI panel.

I tried to add httpd-extprocessors.conf and httpd-scripthandler.conf in the configuration file. After saving the changes and restarting OLS, the pages do not work. I get a 404 error.

Then I run the command:

[root @ server conf] # cd / usr / local / directadmin / custombuild /
[root @ server custombuild] # ./build rewrite_confs
Checking to ensure /usr/local/lsws/ssl.crt/server.ca is set.
Using xx.xx.xx.31 for your server IP
CloudLinux Selector setup: successful
PHP has been secured.
Defaulting to Comodo WAF SecDefaultAction ...
Restarting openlitespeed.


Now the pages are working, but the files that I edited have returned to the previous version.

I have a test domain and I add to the htaccess file: <FilesMatch "\. (Php4 | php5 | php3 | php2 | php | phtml) $"> RemoveHandler .php SetHandler application / x-lsphp81 </FilesMatch> Nothing happens when the openlitespeed is reset.
 
If you have full access to server and cloudlinux - I think it's DA license without domains limits? in such case maybe easier to move each domain to separate account and configure separate PHP for each by standart tools (without htaccess).
---
also check file: /etc/cl.selector/symlinks.rules
there just one line:
php.d.location = selector
I don't remember for what exactly it was modified, but it was set manually to allow change php versions (maybe for htaccess rules as you want to use).
 
I finally ran the DA selector with selected php versions. It worked
 
i have the same problem. How you solve it?

Directadmin offers its own PHP selector. I believe the user switched to using the PHP selector from DirectAdmin, and that's was the solution. When using the DA selector you might face issues with the CloudLinux Selector, so usually you would need to choose and stick to either of the two.
 
Back
Top