Lassen Sie mich nur feststellen, dass ich neu bei FastCGI bin. Ich habe MAMPs Apache auf meinem OS X-Rechner. Der Standard-PHP-Handler war Apache Handler 2.0
(libphp5.so). Ich wollte hier FastCGI
und folgte die Antwort ändern:Unterschied zwischen FastCgiExternalServer und FastCgiServer in Apache FastCGI PHP?
<IfModule mod_fastcgi.c>
AddHandler php5.fcgi .php
Action php5.fcgi /php5.fcgi
Alias /php5.fcgi /Applications/MAMP/fcgi-bin/php5.fcgi
FastCgiServer /Applications/MAMP/fcgi-bin/php5.fcgi -socket /Applications/MAMP/tmp/php-fcgi/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
#FastCgiExternalServer /Applications/MAMP/fcgi-bin/php5.fcgi -socket /Applications/MAMP/tmp/php-fcgi/php5-fpm.sock -pass-header Authorization -idle-timeout 3600
<Directory /Applications/MAMP/fcgi-bin>
Order allow,deny
Allow from all
</Directory>
</IfModule>
Doch wie Sie sehen können, FastCgiExternalServer
Kommentar gesetzt ist: How to configure Apache to run PHP as FastCGI on Ubuntu 12.04 via terminal?
ich folgendes am Ende meiner httpd.conf hinzugefügt. Stattdessen hatte ich FastCgiServer
Ursache sonst Apache gab mir die folgenden Fehler zu verwenden, wenn eine Seite anzufordern versuchen:
[Fr Mai 06 23.25.22 2016] [Fehler] [client :: 1] (2) Keine solche Datei oder Verzeichnis: FastCGI: Verbindung zum Server fehlgeschlagen "/Applications/MAMP/fcgi-bin/php5.fcgi": connect() fehlgeschlagen
[Fr May 06 23:25:22 2016] [ Fehler] [client :: 1] FastCGI: unvollständige Header (0 Bytes) vom Server empfangen "/Applications/MAMP/fcgi-bin/php5.fcgi"
Aber /Applications/MAMP/fcgi-bin/php5.fcgi
existiert und dessen Inhalt ist:
#!/bin/bash
PHP_CGI=/Applications/MAMP/bin/php/php5.6.2/bin/php-cgi
exec $PHP_CGI
Was ist der Unterschied zwischen FastCgiServer
und FastCgiExternalServer
und warum FastCgiExternalServer
nicht funktionierte in meinem Fall aber FastCgiServer
funktionierte?
zu lernen Wenn Sie PHP FastCGI im Jahr 2016 tun, schauen mod_proxy_fcgi und php-fpm statt mod_fastcgi. – covener