2014-06-20 27 views
0

我實際上是想在WAMP上安裝zend框架。我遵循this tutorial的說明。我遇到了一個問題。我在目錄C:\ websites \ test中設置了Zend Framework。我編輯的文件C:\ wampzend \ BIN \ apache的\ apache2.4.9 \的conf \額外\根據指南中的說明的httpd-vhosts.conf:設置zend框架時禁止使用Wamp 403

<Directory c:/websites> 
    Options Indexes FollowSymLinks 
    DirectoryIndex index.php 
    AllowOverride All 
    Order Deny,Allow 
    Allow from all 
</Directory> 
<VirtualHost *:80> 
    DocumentRoot "C:/wampzend/www" 
    ServerName localhost 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot "C:/websites/test/public" 
    ServerName test 
    SetEnv APPLICATION_ENV "development" 
</VirtualHost> 

我還編輯我的hosts文件,並進入從測試指針到127.0.0.1。如果我去url測試,我會得到一個403 Forbidden響應。指向wampzend/www的localhost工作正常。 403響應的任何解決方案?

+0

你的錯誤日誌說什麼?大多數情況下,你會發現更多的信息爲什麼給403。 – hakre

回答

0

試試這個,相反,目錄訪問權限的分配真的屬於......定義內部,並且應該特定於那個VHOST。

<VirtualHost *:80> 
    DocumentRoot "C:/wampzend/www" 
    ServerName localhost 
    <Directory "c:/wampzend/www"> 
     AllowOverride All 
     Order Deny,Allow 
     Deny from all 
     Allow from 127.0.0.1 localhost ::1 
    </Directory> 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot "C:/websites/test/public" 
    ServerName test 
    SetEnv APPLICATION_ENV "development" 
    <Directory "c:/websites/test/public"> 
     Options Indexes FollowSymLinks 
     DirectoryIndex index.php 
     AllowOverride All 
     Order Deny,Allow 
     Deny from all 
     Allow from 127.0.0.1 localhost ::1 
    </Directory> 
</VirtualHost> 

使用Allow from all肯定是在殺人,尤其是當你剛剛發展,而不是讓訪問世界。 它實際上不會給世界上的訪問權限,除非你將端口轉發給你的路由器,但是當你嘗試這樣做時,最好的做法是隻有你真正希望對世界可見的站點是。