FoggyLog

Sat Sep 19th 2015 11:57:12: Synology NAS - PHP Function fopen() fails on Webserver

Out of the box, when you try and open a file for writing using fopen the function fails with a permissions error such as "Warning: fopen(file.txt): failed to open stream: Permission denied in /volume1/web/index.php"

To resolve this...

  1. Open the Synology Diskstation Control Panel
  2. Click on "Shared Folder"
  3. Click on the shared folder that contains the file your PHP is trying to open for writing.
  4. Click "Edit"
  5. Go to permissions
  6. Choose "Local Groups"
  7. Give the group "http" Read/Write access
  8. Click OK

It then should work

 

Add New Comment

Name:
Email:
(Never displayed publically)
Comment:
HTML Tags allowed - <b>bold</b>, <i>italic</i> and <a href="http://...">Links</a>
Type "NoSpam" in Here:

 

<< Back