LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   File Permission Error in PHP fopen() function (https://www.linuxquestions.org/questions/linux-software-2/file-permission-error-in-php-fopen-function-80533/)

tuka 08-09-2003 09:08 PM

File Permission Error in PHP fopen() function
 
My Question has to do with the following error given by the following line in my PHP code. Also included is the details of the files and foolder. In this case the file I want is in the Chapter02 folder and is also owned by root.

Errors returned from PHP (browser):

Warning: fopen("/var/www/html/chapter02/orders.txt", "a") - Permission denied in /var/www/html/chapter02/processorder.php on line 55


Line in Source:
$fp = fopen ("$DOCUMENT_ROOT/chapter02/orders.txt", "a");


A brief listing of my root:
dr-xr-xr-x 2 root root 4096 Aug 10 01:59 chapter01
dr-xr-xr-x 2 root root 4096 Aug 10 02:20 chapter02
dr-xr-xr-x 2 root root 4096 Feb 22 2001 chapter03



It seems to me that this may be a permissions issue according to the which user is the owner of a file create in my PHP app - it seems to me that httpd should be the owner and group but I am not sure...

Greatly appreciate your help and clarification to this problem.

Tuka

acid_kewpie 08-10-2003 05:35 AM

i'd assume that "a" is for Append.. so you need write acess as the apache user... which is probably httpd or apache... or maybe web, www etc... if you don't know, run somethign like "ps aux" and see who owns the apache processes

tuka 08-12-2003 08:16 PM

Yes that did it !!! thanks for your help... Tuka


All times are GMT -5. The time now is 07:07 PM.