Install PHP 7.2 in CentOS ISPConfig Server
First you need to install EPEL repo and REMI repo.
To install EPEL, run
1 |
yum install epel-release |
To Install REMI repo, download RPM file for your OS from https://rpms.remirepo.net
For CentOS 6, run
1 |
rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-6.rpm |
For CentOS 7
1 |
rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm |
Install PHP 7.2 with
1 |
yum install php72-php-bcmath php72-php-cli php72-php-common php72-php-fpm php72-php-gd php72-php-intl php72-php-json php72-php-mbstring php72-php-mcrypt php72-php-mysqlnd php72-php-opcache php72-php-pdo php72-php-pear php72-php-pecl-uploadprogress php72-php-pecl-zip php72-php-soap php72-php-xml php72-php-xmlrpc |
Configure PHP-FPM
1 |
vi /etc/opt/remi/php72/php-fpm.d/www.conf |
Find
1 |
listen = 127.0.0.1:9000 |
Replace 9000 with unused port, i used
1 |
listen = 127.0.0.1:9072 |
Restart/Enable PHP-FPM
For CentOS 7
1 2 |
systemctl start php72-php-fpm systemctl enable php72-php-fpm |
For CentOS 6
1 2 |
service php72-php-fpm start chkconfig php72-php-fpm on |
Add PHP Version in ISPConfig
Login to ISPConfig, go to
System > Additional PHP Versions > Add new PHP version
On Next Page, enter name.
1 |
Name: PHP7.2 |
In “FastCGI Settings” tab, fill following details
1 2 |
Path to the PHP FastCGI binary = /opt/remi/php72/root/usr/bin/php-cgi Path to the php.ini directory = /etc/opt/remi/php72 |
In “PHP-FPM Settings” tab, add
1 2 3 |
Path to the PHP-FPM init script = /etc/init.d/php72-php-fpm Path to the php.ini directory = /etc/opt/remi/php72 Path to the PHP-FPM pool directory = /etc/opt/remi/php72/php-fpm.d |
Changing a Sites PHP Version in ISPConfig
Go to sites, click on site you need to change PHP version.
On this page, you need to select value for “PHP” and “PHP Version”. Once changed, you need to wait a minute for the version change to happen. This is done by cronjob, that run every one minute.
1 |
* * * * * /usr/local/ispconfig/server/server.sh &> /dev/null |
You can manually execute the script if you want.