Linux – PHP7.1 como padrão no Apache
1 – Instalar pacotes e iniciar serviços
1 2 3 4 |
[root@centos7]# rpm -ivh http://remi.xpg.com.br/enterprise/remi-release-7.rpm [root@centos7]# yum -y install httpd php71-php-pecl-mysql php71-php-mysqlnd php71 php71-build php71-php php71-php-cli php71-php-common php71-php-fpm php71-php-gd php71-php-mbstring php71-php-mcrypt php71-php-pecl-zip php71-php-xml [root@centos7]# systemctl start httpd php71-php-fpm [root@centos7]# systemctl enable httpd php71-php-fpm |
2 – Alterar confs
1 2 3 4 5 6 7 8 9 10 |
[root@centos7]# vim /etc/httpd/conf.d/php.conf <FilesMatch \.php$> # SetHandler application/x-httpd-php SetHandler "proxy:fcgi://127.0.0.1:9000" </FilesMatch> [root@centos7]# systemctl restart php71-php-fpm [root@centos7]# mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php.conf.old [root@centos7]# systemctl restart httpd |
3 – Testar
1 2 |
[root@centos7]# echo '<?php phpinfo(); ?>' > /var/www/html/info.php [root@centos7]# curl http://localhost/info.php | grep 'PHP Version' | tail -1 | sed -e 's/<[^>]*>//g' |
Continue reading →