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

General support questions including new installations
manifest
Posts: 26
Joined: 2010/12/04 20:48:13

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

Post by manifest » 2011/01/04 19:17:50

I installed php yum install php
when i go to localhost it loads index.html ok but when i type localhost/php.php it says

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


here is a line in my httpd.conf file

# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.php

I dont know what im doing wrong :-(

hansolo
Posts: 231
Joined: 2010/01/13 11:17:42
Location: SI

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

Post by hansolo » 2011/01/04 20:05:07

Perhaps you need to set permissions to the file to make it readable to the world and group users too not just owner -you ? (find the location of the file)
cd to the directory (for example /var/www/html):
[b] cd /var/www/html
chmod 444 filename.php[/b]

manifest
Posts: 26
Joined: 2010/12/04 20:48:13

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

Post by manifest » 2011/01/04 20:21:26

did that already didnt work :( i also reloaded apache

hansolo
Posts: 231
Joined: 2010/01/13 11:17:42
Location: SI

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

Post by hansolo » 2011/01/04 20:32:39

can you post some LOG details from httpd/errorlog
regarding that file error...

manifest
Posts: 26
Joined: 2010/12/04 20:48:13

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

Post by manifest » 2011/01/04 21:10:55

[Mon Jan 03 19:36:52 2011] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
[Mon Jan 03 19:36:52 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jan 03 19:36:53 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Jan 03 19:36:53 2011] [notice] Digest: done
[Mon Jan 03 19:36:53 2011] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Mon Jan 03 19:36:53 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon Jan 03 19:37:06 2011] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon Jan 03 19:37:06 2011] [error] [client 127.0.0.1] File does not exist: /var/www/html/favicon.ico
[Mon Jan 03 19:37:09 2011] [error] [client 127.0.0.1] File does not exist: /var/www/html/favicon.ico
[Mon Jan 03 19:52:13 2011] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon Jan 03 20:19:45 2011] [error] [client 192.168.0.1] Directory index forbidden by Options directive: /var/www/html/
[Mon Jan 03 20:19:45 2011] [error] [client 192.168.0.1] File does not exist: /var/www/html/favicon.ico
[Mon Jan 03 20:19:48 2011] [error] [client 192.168.0.1] File does not exist: /var/www/html/favicon.ico
[Mon Jan 03 20:21:57 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:25:23 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:27:59 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:28:01 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:28:03 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:30:41 2011] [notice] caught SIGTERM, shutting down
[Mon Jan 03 20:30:42 2011] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
[Mon Jan 03 20:30:42 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jan 03 20:30:43 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Jan 03 20:30:43 2011] [notice] Digest: done
[Mon Jan 03 20:30:43 2011] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Mon Jan 03 20:30:43 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon Jan 03 20:30:48 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:31:52 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:31:54 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:35:27 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:39:07 2011] [notice] caught SIGTERM, shutting down
[Mon Jan 03 20:39:08 2011] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
[Mon Jan 03 20:39:08 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jan 03 20:39:08 2011] [notice] Digest: generating secret for digest authentication ...
[Mon Jan 03 20:39:08 2011] [notice] Digest: done
[Mon Jan 03 20:39:08 2011] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Mon Jan 03 20:39:08 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon Jan 03 20:39:16 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[Mon Jan 03 20:39:16 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied

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

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

Post by gerald_clark » 2011/01/04 21:32:22

Why is your httpd trying to access files in / ?

manifest
Posts: 26
Joined: 2010/12/04 20:48:13

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

Post by manifest » 2011/01/04 21:37:48

wot?

User avatar
TrevorH
Site Admin
Posts: 33202
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/04 22:00:37

[quote]
manifest wrote:
wot?[/quote]

In a previous post you had a log with

[quote]
[Mon Jan 03 20:28:03 2011] [error] [client 127.0.0.1] (13)Permission denied: access to /index.php denied
[/quote]

hence the question from Gerald about why it was trying to access files in /. Not /var/www/html/index.php, just /index.php

manifest
Posts: 26
Joined: 2010/12/04 20:48:13

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

Post by manifest » 2011/01/04 22:51:12

because i changed this line in httpd.conf DocumentRoot "/var/www/html"
to
DocumentRoot "/home/my user/Desktop/website/

and when it reloaded it gave an error so i just changed it back

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

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

Post by pschaff » 2011/01/04 23:01:42

So, are you saying the problem is now resolved? If not you may want to look at [url=http://wiki.centos.org/HowTos/SELinux]HowTos/SELinux[/url] and possibly temporarily disable SELinux for testing if it is enabled.

Locked