This PHP error is caused by permissions being set incorrectly for the file. It can be fixed by setting file permissions to 644.
The error message presents as the following:
Warning: include(/path/to/file): failed to open stream: Permission denied in /path/to/origin/script on line NUMBER
Related Articles
Change File Permissions in File Manager
SSH into Shared Server
Changing File Permissions
- Identify the file in question from the error message
- Correct its permissions in one of the following ways:
- Via the cPanel File Manager
- Via SSH
- SSH into the server
- Run the following command as the user:
chmod 644 /path/to/original/script
REPLACE: Replace /path/to/original/script with the file name from the error message.
- Via FTP
NOTE: The exact steps will depend on your FTP client. These steps will cover FileZilla.- Connect using FTP
- Right-click the file mentioned in the error message
NOTE: If connecting as the cPanel user, the starting directory in FileZilla is located at /home/userna5 where userna5 is the cPanel user. - Select File permissions...
- Set the Numeric Value to 644 and click OK