From time to time I get 500 internal server error after copying my pages to the HostGator account. Usually it happens when copying the files from Linux server using the Midnight Commander FTP. However to solution is fast and easy.
The problem why the 500 internal server error comes is that HostGator’s servers expect some file permissions. When you copy your website from another server it may happen that the file’s and folders permissions and different than needed.
To run your website on HostGator hosting without any problem you need to set your files permission to 644 and your folders within the public_html to the 755 chmod. You can use your FTP client or directly the command when you have SSH access to your account.
Another solution could be applied using the cPanel’s file manager. Here is how to do this:
- Log in into your cPanel’s account on the HostGator.
- Click the File Manager icon and open the file manager with the root of the problematic domain/website. The new browser window will appear.
- Select all your folders, click the Change Permissions icon and set the permission to the 755 value (read for all, write for user and execute for all). Then confirm with Change Permissions button.
- Now select all your files (with mouse and Shift key for example), click the Change Permissions, set it to the 644 value and confirm.
You are done. Now you could try to open your website again and if there is not any other problem, it should load correctly and without “500 internal server error” page. If not, I recommend going to the cPanel, clicking the Error Log icon and check what problems your website has.