php7.0-fpm无法正常工作
发布时间:2020-12-13 13:55:10 所属栏目:PHP教程 来源:网络整理
导读:我已经在Ubuntu 16.04机器上安装了Apache php7.0和 mysql,我得到了答案“php没有运行”.这是我的vhost配置: VirtualHost *:80 ServerAdmin webmaster@example.com ServerName www.example.com DocumentRoot /var/www/sites/www.example.com/httpdocs Script
我已经在Ubuntu 16.04机器上安装了Apache php7.0和
mysql,我得到了答案“php没有运行”.这是我的vhost配置:
<VirtualHost *:80> ServerAdmin webmaster@example.com 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> 当我尝试访问该网站时,它不是解析PHP而是将其打印到屏幕上. 有人有什么想法吗? 我已经摆脱了以前用于处理apache 2.2的所有其他fpm的东西,并将此行添加到conf中 ProxyPassMatch ^/(.*.php(/.*)?)$unix:/var/run/php/php7.0-fpm.kermit.sock|fcgi://localhost/var/www/sites/www.example.com/httpdocs 现在我在错误日志中收到以下错误
对于套接字来说,permisssions看起来是正确的 srw-rw---- 1 kermit kermit 0 Mar 21 13:00 php7.0-fpm.kermit.sock= 我不知道它在哪里得到=但是
如果您使用的是PHP-FPM,则应考虑使用mod_proxy_fcgi,它是Apache 2.4中新增的,仅适用于此类用例.
Apache wiki entry for PHP-FPM有一些良好的入门指导.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |