Permission Denied When Using fopen

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
MMcnich
New php-forum User
New php-forum User
Posts: 6
Joined: Wed Apr 11, 2018 4:57 am

Sat May 12, 2018 5:02 am

I have been trying to add a temporary comment box to my website using a writing to a file technique while I am still using databases just so I can receive feedback and then replace it later. However in doing so I found the following issues:

Warning: fopen(comments.html): failed to open stream: Permission denied in \\VSFILE07\STUDENTS-M-R\MARTIN.MCNICHOLAS\WEB\scriptingfortheweb\loginmain.php on line 11

Warning: fwrite() expects parameter 1 to be resource, boolean given in \\VSFILE07\STUDENTS-M-R\MARTIN.MCNICHOLAS\WEB\scriptingfortheweb\loginmain.php on line 12

Warning: fclose() expects parameter 1 to be resource, boolean given in \\VSFILE07\STUDENTS-M-R\MARTIN.MCNICHOLAS\WEB\scriptingfortheweb\loginmain.php on line 13

I am assuming the fwrite and fclose issues are due to the permission being denied. Now there is this one issue the server I am uploading to I do not own or have much access to. At my college they offer students to be able to rent out webspace on their servers and about 4 years back I did so because it was free and easy. Eventually I plan on moving everything elsewhere but for now I still am using the webspace they offer. I don't know much about this issue or how I can fix it IF I can as this may be an issue with the server I am using. Is there a way to fix this? :(

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 719
Joined: Mon Feb 22, 2016 5:52 pm

Sat May 12, 2018 7:33 am

You'll need to contact your college admin to get permissions changed or change the user that PHP runs under.

Post Reply