PHP将无法在Apache中的虚拟主机中运行

时间:2013-01-27 04:33:48

标签: php apache

我无法让PHP脚本在我的虚拟主机中运行。它在默认主机上运行正常,但不会在任何其他主机上运行。我已经尝试了我能在网上找到的所有东西。 Mac 10.8服务器。

#/private/etc/apache2/extra/httpd-vhosts.conf
Listen 80
Listen 8080
Listen 8010
NameVirtualHost *:80
NameVirtualHost *:8080
NameVirtualHost *:8010

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    DocumentRoot "/Library/Server/Web/Data/Sites/Gradschool"
    ServerName gradschool.local
</VirtualHost>

<VirtualHost *:8080>
    DocumentRoot "/Library/Server/Web/Data/Sites/PMST"
    ServerName PMST.local
</VirtualHost>

<VirtualHost *:8010>
    DocumentRoot /library/server/web/data/sites/test
    ServerName test.local
</VirtualHost>

1 个答案:

答案 0 :(得分:2)

可以为虚拟主机禁用PHP。尝试使用“php_admin_flag engine on”启用它:

<VirtualHost *:80>
    DocumentRoot "/Library/Server/Web/Data/Sites/Gradschool"
    ServerName gradschool.local

    <Directory /Library/Server/Web/Data/Sites/Gradschool>
            php_admin_flag engine on
            AllowOverride AuthConfig FileInfo
            Order allow,deny
            allow from all
    </Directory>
</VirtualHost>