I have compiled PHP from source and installed it to /opt/php/5.5.15/
I have also installed (with yum
) httpd
, and mod_fcgid
.
I am trying to configure a virtual host to exec php like this:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/my-site.example.com/site/public
ServerName my-site.example.com
ErrorLog /var/www/my-site.example.com/logs/my-site.example.com-error_log
CustomLog /var/www/my-site.example.com/logs/my-site.example.com-access_log common
<Directory /var/www/my-site.example.com/site/public>
Options +indexes
AllowOverride all
Order allow,deny
Allow from all
Action application/x-httpd-php /php-5.5.15-bin/php-cgi
</Directory>
</VirtualHost>
<IfModule mod_fcgid.c>
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 64
DefaultMaxClassProcessCount 8
IPCConnectTimeout 300
IPCCommTimeout 7200
BusyTimeout 300
<FilesMatch ".+\.ph(p[345]?|t|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
ScriptAlias /php-5.5.15-bin/ /opt/php/5.5.15/bin/
<Directory "/opt/php">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</IfModule>
I am getting this error:
[Thu Aug 14 17:36:20 2014] [error] [client 127.0.0.1] (13)Permission denied: exec of '/opt/php/5.5.15/bin/php-cgi' failed, referer: http://my-site.example.com:10080/
[Thu Aug 14 17:36:20 2014] [error] [client 127.0.0.1] Premature end of script headers: php-cgi, referer: http://my-site.example.com:10080/
I have tried chmod 777 php-cgi
and chown apache:apache php-cgi
, both made no difference.
Any ideas?
Note: this setup works fine on Debian
SELINUX=permissive
After that, reboot the server.