Install PHP7 from Remi repo
I installed PHP7 from Remi repo with
sudo yum -y install httpd
sudo yum -y install epel-release
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm
sudo yum -y --enablerepo=remi,remi-test install php70
scl enable php70 'php -v'
sudo ln -s /usr/bin/php70 /usr/bin/php
and it is working via CLI. Now I want to make it work with apache but i can't find a so to pass as a second argument to LoadModule
LoadModule php7_module unknown_path
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Is this the correct approach to make PHP7 to work with apache2?
By default "php70" (Software Collection) don't install the mod_php.
yum install php70-php
And check you haven't any other mod_php (such as the one provided by "php" base package)
FYI for those looking to install PHP 7 using the remi-php70
repository (now that PHP 7.0.0 has been released), you can install packages using the same package names you know and love, for example:
php
php-cli
php-common
php-devel
php-fpm
php-gd
php-mbstring
php-pdo
- etc.
For anyone else trying to upgrade from PHP 5.6 to 7.0.1 on Centos 6.7:
I managed to get this working today almost like @mbalparda has listed but without using epel-release (though a few epel repos are enabled and in use)
I had php 5.6 from IUS (https://ius.io/GettingStarted/) repo (https://centos6.iuscommunity.org/ius-release.rpm) installed, so I removed them by:
# yum list installed | grep php5
php56u.x86_64 5.6.14-1.ius.centos6
php56u-cli.x86_64 5.6.14-1.ius.centos6
php56u-common.x86_64 5.6.14-1.ius.centos6
...
and so
# yum erase php56u php56u-cli php56u-common php56u-mcrypt php56u-mysqlnd ...
followed by the listed commands:
# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# rpm -Uvh remi-release-6.rpm
# yum install php70-php php70-php-cli php70-php-common php70-php-mcrypt php70-php-mysqlnd ...
# scl enable php70 'php -v'
# sudo ln -s /usr/bin/php70 /usr/bin/php
# service httpd restart
PHP70 also seems to install everything under /etc/opt/remi/php70/:
you'll need to run:
source /opt/remi/php70/enable