+2 votes
in General IT Tips by (71.8k points)
I am using Centos Web Panel (CWP) as control panel on my VPS. I have two websites hosted on the VPS which need different PHP versions. How can I assign different PHP versions to my websites?

1 Answer

+1 vote
by (353k points)
selected by
Best answer

You can use different PHP versions for your domains hosted on a VPS. Since you are using CWP as a control panel, do the following steps to select a PHP version for your domain.

1. After logging into the CWP panel, select 'PHP-FPM Selector' from 'PHP settings' present on the Navigation panel. Using 'PHP-FPM Selector', install PHP versions that you want to assign to your domains.

2. From 'Webserver Settings' present on the Navigation panel, select 'Webservers Domain Conf'.

3. Select the username for your domain whose PHP version you want to change.

4. Select the Domain name and click on 'Create Configuration'.

5. Under the configuration, select one option (nginx-> php-fpm, Nginx -> apache -> php-fpm, etc.)

6. It will show the following screen. Select your desired PHP version and click on 'Save Changes'. I would recommend selecting 'Additional Options: Rebuild Webservers conf'. Thus, your domain will use your selected PHP version.

different PHP versions for domains