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

General support questions including new installations
User avatar
TrevorH
Site Admin
Posts: 33220
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2011/01/05 01:17:51

Looks more like you had changed DocumentRoot to "/"

manjun
Posts: 1
Joined: 2014/02/08 16:21:04

Re: You don't have permission to access /php.php on this ser

Post by manjun » 2014/02/08 16:32:58

All files and directories are labeled with a type according to SELinux policy.

Type following command as root and see what type the file is.

ls -Z /var/www/html/<your file path> Ex: ls -Z /var/www/html/index.html

if it has read access then it should show type as httpd_sys_content_t. if it is something else like "user_home_t" or "samba_share_t" then you won't be able to access it even if it has write permission on your linux box.

drwxr-xr-x root root system_u:object_r:httpd_sys_content_t:s0 /var/www/html/index.html

run the following command to change the type of the file and restart the server. you should be able to access.

chcon -R -t httpd_sys_content_t /var/www/html/index.html

to make it permanent

semanage fcontext -a -t httpd_sys_content_t /var/www/html/index.html

then restart your server.

gandalfthebeige
Posts: 1
Joined: 2015/04/29 17:37:56

Re: You don't have permission to access /php.php on this ser

Post by gandalfthebeige » 2015/04/29 17:49:39

I know it's an old thread, but I wanted to add this anyway as it may very well help someone.

I'm running Apache ITK on the server in question and kept getting this in the error log:

Code: Select all

[Wed Apr 29 11:01:25 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.cgi denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.html denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.html.var denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.htm denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.php denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.phtml denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /index.php3 denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /home.html denied
[Wed Apr 29 11:03:05 2015] [error] [client xxx.xxx.xxx.xxx] (13)Permission denied: access to /home.htm denied
Found that there was a VirtualHost which was lacking the AssignUserId directive. So the files were all owned by itkuserxxx:itkuserxxx but apache was running as the default nobody:nobody.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: You don't have permission to access /php.php on this ser

Post by gerald_clark » 2015/04/29 18:48:13

Don't post nonsense to old threads.
Httpd does not run as nobody.nobody.

Locked