Windows安裝laravel出現You don't have permission to access / on this server. 安裝完wamp以後,安裝網上的教程設置虛擬路徑,出現了問題,一樣的問題由不一樣的緣由致使。但願對有些大意的人有幫助。php
一、httpd.conf去掉Include conf/extra/httpd-vhosts.conf前面的#。laravel
二、httpd.conf中添加Listen 相應的端口,個人是8080web
三、在conf\extra下面的httpd-vhosts.conf文件中添加ide
<VirtualHost *:8080> DocumentRoot D:/wamp/www/aa ServerName localhost <Directory 「d:/wamp/www/aa」> Options Indexes FollowSymLinks Order allow,deny Allow from all AllowOverride All </Directory>
</VirtualHost> 四、而後調用localhost,就出現下面的錯誤:this
Forbidden You don’t have permission to access /on this server.code
(沒有設置這一切時,localhost訪問的沒有問題的)server
五、最後發現是沒有刪掉httpd-vhosts.conf文件中的這段代碼致使的:教程
<VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot 「c:/Apache23/docs/dummy-host.example.com」 ServerName dummy-host.example.com ServerAlias www.dummy-host.example.com ErrorLog 「logs/dummy-host.example.com-error.log」 CustomLog 「logs/dummy-host.example.com-access.log」 common </VirtualHost>get
刪掉或者註釋掉這段代碼,再運行localhost就沒有問題了。io
六、localhost運行好使了,但運行localhost:8080卻有新的問題:
Forbidden You don’t have permission to access /index.phpon this server.
七、而後也是找了不少,可能是說什麼allow from all等等的問題。但不管我怎麼設置都是這個問題。
幾經波折,發現把Options Indexes FollowSymLinks 後面添加上 ExecCGI就好使了。 <VirtualHost *:8080> DocumentRoot D:/wamp/www/aa ServerName localhost <Directory 「d:/wamp/www/aa」> Options Indexes FollowSymLinks ExecCGI Order allow,deny Allow from all AllowOverride All </Directory> </VirtualHost>