Soma Mizobuchi Soma Mizobuchi - 1 year ago 117
PHP Question

fopen() Permission Denied despite having correct file directory

$handle = fopen('/Applications/XAMPP/xamppfiles/htdocs/test/file.txt', 'w');

I tried doing the above and every time I try it, the following statement appeared on my browser:

[function.fopen]: failed to open stream: Permission denied in
/Applications/XAMPP/xamppfiles/htdocs/test/index.php on line 26.

I tried looking through answered questions with the same type of questions but most of the things I tried did not work. For example, writing the full directory...

Answer Source

Maybe, you have no premissions to acces the file. One of the answet, is that, you must change CHMOD to e.g. 777. You can co it with your ftp explorer or with PHP.

chmod("/somedir/somefile", 777);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download