我對PHP和Web服務器完全陌生。我有一個測試PHP文件。當我在終端運行這個我可以看到,PHP是工作「PHP /Users/Fryza/Sites/phptest.php」我的Apache本地主機不工作 - 禁止訪問
當我鍵入這些到Web瀏覽器,我得到403 Forbidden錯誤:
http://localhost/~fryza/phptest.php
http://localhost/phptest.php
我有了這些內容的文件(/private/etc/apache2/users/fryza.conf):
<Directory "/Users/fryza/Sites/">
Options FollowSymLinks Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我在DocumentRoot的私人的/ etc/apache2的/ httpd.conf文件是/ Users/Fryza /網站/
我也有這個目錄/圖書館/網絡服務器/文件 - 我曾經有這個作爲文檔根,但它不在這個位置工作。
我已經通讀了一堆堆棧溢出帖子,但他們不適合我。
apache服務器肯定在運行。 PHP正在工作。只是無法讓文件加載到瀏覽器中。
我跑山獅
和我一樣的教程這裏的傢伙和我有同樣的問題: 403 Forbidden error when accessing localhost on Mac OS X10.8
這是錯誤日誌:
[Mon Oct 28 17:57:17 2013] [notice] caught SIGTERM, shutting down
[Mon Oct 28 17:57:17 2013] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Oct 28 17:57:17 2013] [warn] module php5_module is already loaded, skipping
[Mon Oct 28 17:57:17 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Oct 28 17:57:17 2013] [notice] Digest: done
[Mon Oct 28 17:57:17 2013] [notice] Apache/2.2.24 (Unix) DAV/2 PHP/5.3.26 mod_ssl/2.2.24 OpenSSL/0.9.8y configured -- resuming normal operations
訪問日誌: :: 1 - - [28/Oct/2013:18:05:38 -0700]「GET /~fryza/phptest.php HTTP/1.1」403 220
檢查訪問和錯誤日志。 – zerkms
看到添加的錯誤日誌 – Spentak
我猜你甚至無法從你的文檔根目錄訪問純HTML文件?換句話說,你有沒有嘗試加載一個index.htm或.html文件? – jmbertucci