I have installed Apache php7.0
and mysql
on an Ubuntu 16.04 machine and I get the answer "php is not running." Here is my vhost configuration:
<VirtualHost *:80> ServerAdmin [email protected] ServerName www.example.com DocumentRoot /var/www/sites/www.example.com/httpdocs ScriptAlias "cgi-bin" "/var/www/sites/wwww.example.com/cgi-bin" ErrorLog ${APACHE_LOG_DIR}/www.example.com.error_log LogLevel debug CustomLog ${APACHE_LOG_DIR}/www.example.com.log combined <IfModule mod_fastcgi.c> AddHandler php7-fcgi .php Action php7-fcgi /php7-fcgi virtual Alias /php7-fcgi-kermit /usr/lib/cgi-bin/php7-fcgi-kermit FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi-kermit -socket /run/php/php7.0-fpm.kermit.sock -pass-header Authorization <Directory "/usr/lib/cgi-bin"> Require all granted </Directory> </IfModule> <IfModule mod_fastcgi.c> <FilesMatch ".+\.ph(p[345]?|t|tml)$"> SetHandler php7-fcgi-kermit </FilesMatch> </IfModule> </VirtualHost>
When I try to go to the site it is not parsing the php but printing it to the screen.
Does anybody have any ideas?
I have gotten rid of all of the other fpm stuff that used to work with apache 2.2 and have added this line to the conf
ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php/php7.0-fpm.kermit.sock|fcgi://localhost/var/www/sites/www.example.com/httpdocs
Now I get the following error in the error logs
[Wed Mar 21 13:04:35.539499 2018] [proxy:error] [pid 26569] (13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php/php7.0-fpm.kermit.sock (localhost) failed
The permisssions look correct for the socket
srw-rw---- 1 kermit kermit 0 Mar 21 13:00 php7.0-fpm.kermit.sock=
I do not know where it is getting that = sign though