I'm running into some problems while attempting to run PHP via FastCGI in Apache. I have the FastCGI module loaded, but get the following error when attempting to load a page:

The requested URL /fastcgi/php54.fcgi/index.php was not found on this server.

Somewhere, it seems that the script to be executed is appended to the executable without any spaces. Is this where the problem likely is? Below I've included snippets from my Apache configuration (hopefully this is enough):

LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so

FastCgiIpcDir /var/run/fastcgi
AddHandler fastcgi-script .fcgi
FastCgiConfig -autoUpdate -singleThreshold 100 -killInterval 300
AddType application/x-httpd-php .php
ScriptAlias /fastcgi/ /Library/WebServer/FCGI-Executables/

<Directory "/Library/WebServer/FCGI-Executables">
    Options +ExecCGI
    SetHandler fastcgi-script
    Order allow,deny
    Allow from all

<VirtualHost *:80>
    ServerName www.somedomain.com
    ServerAdmin admin@example.com
    DocumentRoot "/Web/www.somedomain.com"
    DirectoryIndex index.html index.php default.html
    CustomLog /var/log/apache2/access_log combinedvhost
    ErrorLog /var/log/apache2/error_log

    Action application/x-httpd-php /fastcgi/php54.fcgi

    <IfModule mod_ssl.c>
            SSLEngine Off
            SSLCipherSuite "ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM"
            SSLProtocol -ALL +SSLv3 +TLSv1
            SSLProxyEngine On
            SSLProxyProtocol -ALL +SSLv3 +TLSv1

    <Directory "/Web/www.somedomain.com">
            Options All -Indexes +ExecCGI +Includes +MultiViews
            AllowOverride All
            <IfModule mod_dav.c>
                    DAV Off
            <IfDefine !WEBSERVICE_ON>
                    Deny from all
                    ErrorDocument 403 /customerror/websitesoff403.html

... and this is the executable:




exec /opt/local/bin/php-cgi54

Turns out I had the wrong path:

ScriptAlias /fastcgi/ /Library/WebServer/FCGI-Executables/

should have been

ScriptAlias /fastcgi/ /Library/Server/Web/Data/FCGI-Executables/
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.