Skip to main content

Installation - PHP

CentOS

Using mod_php

Install the Software Collection repository

yum -y install centos-release-scl

Install the PHP 7.0

yum -y install rh-php70 rh-php70-php rh-php70-php-fpm

Find out rh-php70-php (mod_php) installed files

repoquery -l rh-php70-php

List SCL packages

scl -l

Enable PHP 7.0 on current shell session

scl enable rh-php70-php

Enable mod_php

ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php70-php.conf /etc/httpd/conf.d/

ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php70-php.conf /etc/httpd/conf.modules.d/

ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php70-php7.so /etc/httpd/modules/

Restart Apache

systemctl restart httpd

Ref: CentOS WiKi

Ref: NextCloud manual

Using PHP FPM

yum -y install rh-php70-php-fpm

Allow on SELinux

semanage port -a -t http_port_t -p tcp 9000

Enable PHP FPM service

systemctl enable rh-php70-php-fpm
systemctl start rh-php70-php-fpm

Ref: Apache PHP FPM