文件未找到。 Apache + php-fpm

时间:2015-11-17 21:00:50

标签: php fastcgi apache2.2

当我使用没有vhosts的默认配置时,一切正常。但是当我添加虚拟主机时,它无法工作..

以下是vhost的样子:

<VirtualHost *:80>

    ServerName example   
    ServerAlias example.com                                                                                                                                                                                                                                                   $
    ServerAdmin example@example.com
    DocumentRoot "/home/example/public_html"
    ErrorLog "/home/example/logs"
    CustomLog "/home/example/logs1.log" combined
    ScriptAlias /cgi-bin/ /home/example/cgi-bin/
    Alias /phpmyadmin /home/phpmyadmin

    <Directory "/home/example/public_html">
      AllowOverride All  
      Order allow,deny
      Allow from all
      DirectoryIndex index.php index.html index.htm default.htm
    </Directory>

   <Directory "/home/phpmyadmin">
      AllowOverride All  
      Order allow,deny
      Allow from all
      DirectoryIndex index.php index.html index.htm default.htm
      Options -Indexes
   </Directory>

</VirtualHost>

我也在httpd.conf

中有这个
<IfModule mod_fastcgi.c>  
    FastCGIExternalServer /usr/sbin/php-fpm -host 127.0.0.1:9000
   AddHandler php-fastcgi .php  

    <LocationMatch "/status">
      SetHandler php-fastcgi-virt
      Action php-fastcgi-virt /usr/sbin/php-fpm.fcgi virtual
    </LocationMatch>

   Action php-fastcgi /usr/sbin/php-fpm.fcgi  
    ScriptAlias /usr/sbin/php-fpm.fcgi /usr/sbin/php-fpm  

    <Directory /usr/sbin>  
      Options ExecCGI FollowSymLinks  
      SetHandler fastcgi-script  
      Order allow,deny  
      Allow from all  
   </Directory>  
  </IfModule>

当我访问页面时,我得到:

File not found.

以下是我在日志文件中获得的内容:

  

[Tue Nov 17 19:50:00 2015] [错误] [client 192.168.1.68] FastCGI:   服务器“/ usr / sbin / php-fpm”stderr:主要脚本未知

对此有何解决方案?

0 个答案:

没有答案