User Tools

Site Tools


directadmin:more-php

How to install more than 2 php versions

To install more than 2 versions of php need to do next steps:

1. build a new PHP version, Lets say 5.3, but you may repeat the process for 5.4, 5.5, 7.0, 7.1 and 7.2

cd /usr/local/directadmin/custombuild
./build update
./build php_expert 5.3 php-fpm

2. Create a config file for new PHP version for user XXX:

cd /usr/local/directadmin/data/users/XXX/php/
cp php-fpm56.conf php-fpm53.conf
edit php-fpm53.conf and replace line
listen = /usr/local/php56/sockets/$pool.sock
with
listen = /usr/local/php53/sockets/$pool.sock

3. Start new PHP fpm service

systemctl restart php-fpm53.service

if /etc/systemd/system/php-fpm53.service does not exist, you must create it from a similar one from /etc/systemd/system/php-fpm56.service

4. Edit .htaccess, replace XXX with your user

<FilesMatch "\.(inc|php|phtml|phps)$">
SetHandler proxy:unix:/usr/local/php53/sockets/XXX.sock|fcgi://localhost/
</FilesMatch>

5. Test how it works

directadmin/more-php.txt · Last modified: 2018/06/22 16:21 by dreiggy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki