If your script is giving you an error when you try to write to a file, it is likely that there are incorrect permissions on either your script or your file.
All users must be able to execute the file and the script.
If you log into your eXtend Control Panel, you can check the permissions of your files by clicking ‘Check Site Permissions’. After you run the scan, you can then adjust permissions as necessary through the File Manager.
To adjust permissions in File Manager:
Test your script again in your browser. If you are still seeing a server error, it might be the code within the script itself.
Article ID: 408
Created On: Mon, Mar 16, 2015 at 3:19 PM
Last Updated On: Thu, Apr 23, 2015 at 12:14 PM
Online URL: https://www.heartinternet.uk/support/article/why-am-i-getting-an-error-when-my-script-tries-to-write-to-a-file.html