lalabored Posted May 14, 2007 Share Posted May 14, 2007 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 More sharing options...
clown[NOR] Posted May 14, 2007 Share Posted May 14, 2007 make sure it's readable.. try chmod 777 Link to comment https://forums.phpfreaks.com/topic/51248-permission-error-when-using-fopen/#findComment-252459 Share on other sites More sharing options...
lalabored Posted May 14, 2007 Author Share Posted May 14, 2007 It's already 777, it still isn't working. Link to comment https://forums.phpfreaks.com/topic/51248-permission-error-when-using-fopen/#findComment-252475 Share on other sites More sharing options...
clown[NOR] Posted May 14, 2007 Share Posted May 14, 2007 may we see some code ... does the job easier Link to comment https://forums.phpfreaks.com/topic/51248-permission-error-when-using-fopen/#findComment-252694 Share on other sites More sharing options...
lalabored Posted May 14, 2007 Author Share Posted May 14, 2007 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. Link to comment https://forums.phpfreaks.com/topic/51248-permission-error-when-using-fopen/#findComment-252832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.