我尝试使用apache设置php-fpm
我仍然错过了一块拼图,因为页面返回一个404
The requested URL /php-fpm/index.php was not found on this server. Apache/2.2.24 (Unix) DAV/2 mod_fastcgi/2.4.6 Server at test.dev Port 80
从我所理解的是,别名中提到的path不一定存在,但它应该与下面的ExternalServer指令匹配。 套接字path与在php-fpmconfiguration中设置的完全相同。 我chmodded -R 777 var和tmp目录和站点目录。 我看到socket和fastcgi具有相同的所有者“_www”,那些是默认设置,并且没有必要改变它们。
php54 –with-php-fpm,mod_fastcgi与Homebrew一起安装,但是这个指南也没有帮我
我还可以做些什么? 任何build议非常感谢。
这是我的httpd是什么
<IfModule mod_fastcgi.c> # <FilesMatch \.php$> # SetHandler php-script # </FilesMatch> # Action php-script /php.external # Alias /php.external /var/run/mod_fastcgi/php.fpm AddHandler php-fastcgi .php Action php-fastcgi /php-fpm Alias /php-fpm /var/run/mod_fastcgi/php.fpm FastCGIExternalServer /var/run/mod_fastcgi/php.fpm -socket /tmp/php-fpm.sock -idle-timeout 900 -pass-header Authorization AddType application/x-httpd-fastphp5 .php DirectoryIndex index.php index.shtml index.cgi index.html index.htm Options +Indexes +FollowSymLinks +ExecCGI +Includes +MultiViews <Directory "/var/run/mod_fastcgi/"> Order deny,allow Deny from all <Files "php.fpm"> Order allow,deny Allow from all </Files> </Directory> </IfModule> <VirtualHost *> DocumentRoot "/Users/redres/Webdev/testsite/public" ServerName test.dev ServerAlias www.test.dev <Location /php-fpm> Order Deny,Allow Deny from all Allow from env=REDIRECT_STATUS </Location>
我在Apache 2.2和PHP-FPM上苦苦挣扎了好几天,直到我意识到除非FastCgiWrapper设置为Off否则它不能工作。 不知道这对你有什么影响,但它解决了我的问题。 请注意,由Apache执行的任何 FastCgi脚本在此之后都不会通过suexec运行。 PHP-FPM不需要这个,但是你可以运行其他的FastCgi实例。