I have compiled PHP 7 with FPM support using this tutorial on CentOS 7.x environment.
I was able to test the php through CLI by running.
cd /opt/php7/bin
./php --version
Which outputs
PHP 7.0.6 (cli) (built: May 22 2016 07:20:48) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
I have also installed apache and it is running successfully.
Now I have created vhosts and guided domain to a directory. I have pasted a php file info.php
with the function phpinfo()
but server outputs the PHP function without executing it.
I feel I am really close now and just need to configure apache to run with php-fpm so I put this config on httpd.conf
file but it doesn't help.
<IfModule mod_fastcgi.c>
DirectoryIndex index.html index.shtml index.cgi index.php
AddType application/x-httpd-fastphp7 .php
Action application/x-httpd-fastphp7 /php7-fcgi
Alias /php7-fcgi /opt/php7/bin/php-cgi
FastCgiExternalServer /var/www/html/ -socket /opt/php7/var/run/php-fpm.pid -pass-header Authorization
<Directory /var/www/html/>
Require all granted
</Directory>
</IfModule>
fcgi module is installed beacuse when I run apachectl -t -D DUMP_MODULES
I get fcgid_module (shared)