Jump to content

Permission error when using fopen()


lalabored

Recommended Posts

Why do I always get this error when I use fopen()?

 

Warning: fopen(somefile.php) [function.fopen]: failed to open stream: Permission denied in something on line 172

 

I'm being hosted by someone else right now and I've asked them to CHMOD my folder to a wider permission but it didn't work. Can someone tell me what's wrong?

Link to comment
https://forums.phpfreaks.com/topic/51248-permission-error-when-using-fopen/
Share on other sites

This is the code that I used...

 

<?php

$fh = fopen("write.php","a") or die("Cannot open file.");
fwrite($fh,"alalalalfjaklsdfjo;awdhgfaowfnv");
fclose($fh);
echo "Done!";

?>

 

And this is the error that I get...

 

Warning: fopen(write.php) [function.fopen]: failed to open stream: Permission denied in /home/blahblahblah/asdf.php on line 3
Cannot open file.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.