Re: fopen failing, permission denied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Baker wrote:
I have the following code snippet:
$h = fopen("$path/file.txt", 'x+');

And it generates the following error:
Warning: fopen(/home/...../myarea/file.txt): failed to open stream: Permission denied

The path is correct, but the php process doesn't seem to have file permissions in the folder. Is there some magic I can do to allow php to have file rights to the "myarea" folder? (This is on a purchased ISP site)

Go in through ftp or ssh and fix the permissions.

If you only want to read the file, then it only needs to be 644.

If you need to write the file it will either need to be 646 or 664.

That's your only option apart from deleting the file (through ftp) and recreating it through your php script ... or getting your host to change to the CGI version of php which is most unlikely to happen.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux