# 403 Forbidden

## ergodic

I have this problem on my apache web server with php. All the html pages work ok, but when I try to access .php files I got the following message:

You don't have permission to access /test.php on this server.

I changed the permissions for the files to 755 and checked the config files

 for apache but could not find anything wrong. Any suggestions?

TIA

----------

## mksoft

Did you check apache's error (and access) log  :Question:  If so, what does it say  :Question: 

You can find the error log file in /var/log/apache/error_log.

----------

## ergodic

This is what the log file says, not that I can extract anything useful from it. Maybe you guys can 

10.10.1.122 - - [12/Nov/2002:03:34:16 -0800] "GET /phpmyadmin/index.php HTTP/1.1" 403 292 "http://sqlla/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021028"

10.10.1.122 - - [12/Nov/2002:03:38:19 -0800] "GET /test.php HTTP/1.1" 403 280 "http://sqlla/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021028"

10.10.1.122 - - [12/Nov/2002:03:39:50 -0800] "GET /test.php HTTP/1.1" 403 280 "http://sqlla/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021028"

----------

## simcop2387

i might be wrong but that looks like an access log, not the error log?

----------

## mksoft

Yes, it is the access log. How about psoting the error log  :Question: 

----------

## ergodic

Sorry about that.

This was the ERROR, the options ExecCGI is off, 

[Tue Nov 12 03:38:19 2002] [error] [client 10.10.1.122] Options ExecCGI is off in this directory: /home/httpd/htdocs/test.php

[Tue Nov 12 03:39:50 2002] [error] [client 10.10.1.122] Options ExecCGI is off in this directory: /home/httpd/htdocs/test.php

Turned that option on and this is what I get now 

[Fri Nov 15 07:59:27 2002] [error] [client 10.10.1.122] Premature end of script headers: /home/httpd/htdocs/phpmyadmin/index.php

[Fri Nov 15 08:00:03 2002] [error] (13)Permission denied: exec of /home/httpd/htdocs/phpmyadmin/index.php failed

[Fri Nov 15 08:00:03 2002] [error] [client 10.10.1.122] Premature end of script headers: /home/httpd/htdocs/phpmyadmin/index.php

(END)

TIA

----------

## mksoft

Did you emerge php or mod_php  :Question: 

----------

## ergodic

mod_php

I try uninstalling and reinstalling and nothing ... Don't know what else to try

----------

## mksoft

What about starting with a simple script  :Question:  For example, create a file under /home/httpd/htdocs/, lets call it test.php which will contain:

```
<?php

   phpinfo();

?>
```

And then try to access it with http://localhost/test.php

What do you get in that case  :Question: 

----------

## ergodic

I could not figure out what happened....

I unmerge apache and mod_php and installed apache2 and php from source code (doing g'ol configure ; make; make install )

It works now

----------

