Windows安裝laravel出現You don't have permission to access / on this server.

來源:互聯網
上載者:User

安裝完wamp之後,安裝網上的教程設定虛擬路徑,出現了問題,同樣的問題由不同的原因導致。希望對有些大意的人有協助。

1、httpd.conf去掉Include conf/extra/httpd-vhosts.conf前面的#。

2、httpd.conf中添加Listen 相應的連接埠,我的是8080

3、在conf\extra下面的httpd-vhosts.conf檔案中添加

    <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>


4、然後調用localhost,就出現下面的錯誤: Forbidden

You don’t have permission to access /on this server.


(沒有設定這一切時,localhost訪問的沒有問題的)


5、最後發現是沒有刪掉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>


刪掉或者注釋掉這段代碼,再運行localhost就沒有問題了。


6、localhost運行好使了,但運行localhost:8080卻有新的問題:

Forbidden

You don’t have permission to access /index.phpon this server.


7、然後也是找了很多,多是說什麼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>






相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.