2010-03-21 125 views
0

第一次點蛋糕的用戶和我有真正的Apache問題。由於某些原因,.htaccess試圖找到在Mac OSX上安裝CakePHP:apache問題

File does not exist: /Library/WebServer/Documents/Users 

但是沒有用戶這樣的目錄。我曾嘗試設置下面還有:

/etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80 > 
DocumentRoot "/Users/username/Sites/mysite/app/webroot" 
ServerName mysite.dev 
ServerAlias www.mysite.dev mysite.dev *.mysite.dev 
<Directory "/Users/username/Sites/mysite/app/webroot"> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
</Directory> 
</VirtualHost> 

/etc/hosts中

127.0.0.1 mysite.dev 

的/ etc /apache2/users/username.conf

<Directory "/Users/username/Sites/"> 
    Options Indexes MultiViews FollowSymlinks 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 

這也沒有工作,只是需要「蛋糕/庫/緩存/ file.php」

雖然我寧可不使用虛擬主機,並且只可以堅持本地主機

不同的錯誤而失敗開幕

回答

10

好像是爲我工作是編輯/etc/apache2/users/username.conf並在頂部加入這個解決方案:

DocumentRoot "/Users/username/Sites" 

而且都是默認的CakePHP下載現在運行正常。

+0

這也適用於我。但我想明白:爲什麼這條線需要?謝謝。 – Chuy 2013-11-21 19:30:58

+0

這節省了我的一天..謝謝 – psantos 2014-03-15 11:38:39

3

看起來像Apache正試圖在不同的位置找到你的webroot - 如果內存服務的話,它是默認位置。如果你想使用虛擬主機(這將是我的建議,無論它是值得的),請確保NameVirtualHost指令未註釋。默認情況下,它的註釋:

NameVirtualHost *:80 

如果你喜歡使用虛擬主機無論出於何種原因,確保NameVirtualHost註釋掉了(你<VirtualHost>塊將被忽略),並更改DocumentRoot值到正確的目錄:

DocumentRoot "/Users/username/Sites/mysite/app/webroot" 

這應該告訴Apache在正確的地方去尋找。