所以我只是运行一个干净的安装山狮子OSX 10.8,并试图让一切恢复和运行。 我取消了http.conf中的php模块和vhosts,添加了brew,mcrypt,autoconf等。我使用VirtualHostX,并设置了我的域和本地path,但是当我把它拉起来时,它显示/我的应用程序的索引。
我有一个index.php在我的根,我的虚拟主机看起来像这样:
NameVirtualHost *:80 <Directory "/Users/me/Sites/mysite.com/public/"> Allow From All AllowOverride All Options +Indexes </Directory> <VirtualHost *:80> ServerName "mysite.dev" DocumentRoot "/Users/me/Sites/mysite.com/public" </VirtualHost>
过去我花了好几个小时解决了这些问题……好起来了,但这是一个新问题,我似乎无法find问题所在。
在你的apacheconfiguration文件中查找DirectoryIndex (可能在httpd.conf中),并检查index.php是否存在。 我认为这不是。
您需要在虚拟主机中禁用索引
<Directory /www/somefolder> Options -Indexes FollowSymLinks AllowOverride None </Directory>