开发者

Website local error

I'm building a website. For some reason when I try to run it on the local host, I get this message:

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

localhost Sat Nov 20 22:19:02 2010 Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1

What should I do to fix this so my website shows up on the local host. The w开发者_如何学Cebsite is coded in html/css/php. Thank you.


Look at the error logs.


I would agree with trying to read the apache log file for the specific error.

Sometimes, though, a 403 Forbidden error can be a simple permission error. Make sure the web directories are 755 and files are (atleast) 644 (but don't go chmod'ing everything to 777!)

For example,

chmod 755 /path/to/you/web/root
echo 'testing.. hello world!' > /path/to/you/web/root/test.php 
chmod 644 /path/to/you/web/root/test.php

Hopefully that will get you going. If not, check your apache settings file (usually httpd.conf) and check out any mentioning of you web root. A 403 error can also be caused by apache trying to serve up a directory outside of it's WEBROOT.. meaning the webserver doesn't actually have access to the files.

Good luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜