PHP file write permission
Posted
by
user125862
on Server Fault
See other posts from Server Fault
or by user125862
Published on 2012-06-25T02:31:10Z
Indexed on
2012/06/25
3:17 UTC
Read the original article
Hit count: 119
I have two files, one php file and one log file. The permission has been changed to the following:
-rwxr-x--- 1 www-data www-data 294 2012-06-25 10:17 function.php
-rwxr-x--- 1 www-data www-data 0 2012-06-25 09:53 log.txt
The permission is set to 750.
when I call function.php, I receive the following error message
fopen(log.txt): failed to open stream: Permission denied
This is the line :
$fp = fopen("log.txt","a");
I am very confused. I have php and the file to be written both under www-data now, so why would there be any permission problem?
Please help
© Server Fault or respective owner