From version 0.9.8 all CWP servers have a CWP PHP Selector which can install all PHP versions with a single click.
Using CWP PHP selector you can use a different PHP version per folder or domain.
Available PHP versions in the CWP PHP Selector
- php 4.4
- php 5.2
- php 5.3
- php 5.4
- php 5.5
- php 5.6
- php 7.0
- php 7.1
- php 7.2
- php 7.x (development version from php git, don't use for production server!!!)
You can completely modify flags per PHP version according to you needs.
PHP per folder
Now each user can run PHP version per folder, meaning that each folder can have a different php version, example:
/home/USERNAME/public_html runs PHP 5.4
/home/USERNAME/public_html/test runs PHP 5.6
/home/USERNAME/public_html/my-domain.com runs PHP 5.2
/home/USERNAME/public_html/my-domain.com/application runs PHP 5.3
Usage instructions
In each folder you want to run different PHP version you only need to define it in the .htaccess file.
Example for file: /home/USERNAME/public_html/.htaccess
Use PHP 4.4
AddHandler application/x-httpd-php44 .php
Use PHP 5.2
AddHandler application/x-httpd-php52 .php
Use PHP 5.3
AddHandler application/x-httpd-php53 .php
Use PHP 5.4
AddHandler application/x-httpd-php54 .php
Use PHP 5.5
AddHandler application/x-httpd-php55 .php
Use PHP 5.6
AddHandler application/x-httpd-php56 .php
Use PHP 7.0
AddHandler application/x-httpd-php70 .php
Use PHP 7.1
AddHandler application/x-httpd-php71 .php
Use PHP 7.2
AddHandler application/x-httpd-php72 .php
To run some other PHP version in the other folder, you can use the same example.
Example lets run php 5.3 in /home/USERNAME/public_html/domain1.com/
Edit /home/USERNAME/public_html/domain1.com/.htaccess file and add
AddHandler application/x-httpd-php53 .php
Example lets run php 5.2 in /home/USERNAME/public_html/domain2.com/
Edit /home/USERNAME/public_html/domain2.com/.htaccess file and add
AddHandler application/x-httpd-php52 .php
php.ini configuration file locations
/opt/alt/php44/usr/php/php.ini
/opt/alt/php52/usr/php/php.ini
/opt/alt/php53/usr/php/php.ini
/opt/alt/php54/usr/php/php.ini
/opt/alt/php55/usr/php/php.ini
/opt/alt/php56/usr/php/php.ini
/opt/alt/php70/usr/php/php.ini
/opt/alt/php71/usr/php/php.ini
/opt/alt/php72/usr/php/php.ini
php config file scan dir
/opt/alt/php44/usr/php/php.d
/opt/alt/php52/usr/php/php.d
/opt/alt/php53/usr/php/php.d
/opt/alt/php54/usr/php/php.d
/opt/alt/php55/usr/php/php.d
/opt/alt/php56/usr/php/php.d
/opt/alt/php70/usr/php/php.d
/opt/alt/php71/usr/php/php.d
/opt/alt/php72/usr/php/php.d
and so on.
To delete some php selector version use this command (example)
rm -Rf /opt/alt/php71
be careful with this command as you can easily delete wrong path.