Why am I getting an error when my script tries to write to a file?


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:

  1. Log into your eXtend Control Panel
  2. Click ‘File Manager’
  3. Double-click the directories until you are in the one that contains your script
  4. Click on your script
  5. Click on the Padlock icon (Chmod)
  6. Enter in 755 next to ‘Or enter a mode number’
  7. Click ‘Save’
  8. Double-click into the directory that holds your file
  9. Click on your file
  10. Click on the Padlock icon
  11. Enter in 755 next to ‘Or enter a mode number’
  12. Click ‘Save’

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