[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 832
  • Last Modified:

Apache fails to run php unless browser ran by root

I have a Fedora live install with the following options installed: apache and wordpress

When I finished setting up the mysql database, configuring wordpress and finally browsing to the localhost in firefox nothing would show up as a general user.  I logged in as root on the server and launched firefox and it works perfectly.  Here are the log files from apache:
error_log
[Thu Feb 07 20:35:50 2008] [error] [client x.x.x.x] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Thu Feb 07 20:35:50 2008] [error] [client x.x.x.x] PHP Fatal error:  Unknown: Failed opening required '/var/www/html/wordpress/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

Is there something the fedora install does that needs to be changed to allow users to run php?  I put a hi.txt file in the same directory and I can specify it from a browser and get it running as a regular user and remotely from another machine.
0
jfolcik
Asked:
jfolcik
1 Solution
 
emphamyCommented:
this is because you installed some files under root and are running php as probably a non root user. usually apache and php run under their own account of nobody and if you install files using root it won't read it.

so change the permissions on the files in /www/ or run apache/php as root, not recommended.
0
 
jfolcikAuthor Commented:
I figured it out, with SELinux turned on php doesn't work, once I turned it off everything was perfect.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now