Link to home
Start Free TrialLog in
Avatar of jfolcik
jfolcik

asked on

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.
Avatar of emphamy
emphamy

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.
ASKER CERTIFIED SOLUTION
Avatar of jfolcik
jfolcik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial