views:

334

answers:

2

Hello,

I have a script giving me error 403 Forbidden error, its just a copy of another script but the different in this is that both use another mysql class to access database.

My whole project is complete and this is last file so i dont want to do the whole work again for a single file.

Server logs shows that client denied by server configuration:

so what should i look for?

/////////////// Edited /////////////////

i checked permissions its 644, i even placed a new file with just simple echo and even that was giving a 403 error, i renamed the folder too but no use, however the index.php file is running perfect without any errors.

Thank You.

+5  A: 

Check the permissions and also ownership of the file. Generally, 403 means that the web server doesn't have the rights to read the file and therefore can't continue the request. The permissions may be set correctly, however the file might be owned by another account on the server - an account that isn't part of the same group as the account which is running the server.

For instance, I believe* Apache is ran by default under the httpd user account, which is part of the httpd group. However, the FTP user you're logging in as (for instance ftpuser) might not be part of the httpd group. So, in copying the file you've created it under a different user account and Apache won't get execute access with 644.

* it's been a while since I've used apache, but it's similar under nginx.

digitala
+1: This is the most common cause I've seen of 403 Forbidden errors.
R. Bemrose
i checked permissions its 644, i even placed a new file with just simple echo and even that was giving a 403 error, irenamed the folder too but no use, however the index.php file i running perfect
Shishant
Please see changes to answer.
digitala
A: 

Its totally my mistake, i had denied for all in .htaccess file. Sorry.

Shishant