Apache, PHP, FOPEN Permissions problem



I have a fresh install of Fedora Core 4 with Apache 2.0.54 and PHP.
Initially, default configuration does not start httpd automatically.
During testing, I had started httpd manually at command line while
logged in as root.


All testing works fine. I have a simple 4 or 5 line PHP script that
attempts to open a file for writing. I can open the file and write to
it, close it, etc. No errors.


I configure httpd to start during startup (either via Fedora init.d
scripts or manually adding to rc.local. Apache starts, PHP runs fine
(I can run phpinfo(), etc), but I get a Permission error on the FOPEN
function. The script has not changed. HTTPD is running as user
apache:apache. The file is located at the root level (moved for
testing purposes) with permissions of 777, owned by apache:apache. I
don't think it can get any simpler than this! 'ps aux' shows the httpd

processes are running identically eitherway (as user apache, no special

options)


I open a command window and simply issue the following commands:


/etc/rc.d/init.d/httpd stop
/etc/rc.d/init.d/httpd start


and then the FOPEN command in the script works! This must be something

very simple that I am overlooking. Why does the FOPEN not work when
apache is started at boot time but works fine when stopped/started
after I log in?


Is the PHP environment different depending on when/how Apache is
started?


Please help! I have simple project that is being held up by this
problem.


Thanks in advance!


Kevin

.



Relevant Pages