Issue: 500 Internal Server Error
We have seen this error come up when clients migrate scripts to our server. Client attempts to install a PHP script (such as Drupal, Magento, Moodle, WordPress, Concrete5 etc) from sources or a previous installation of LAMP with mod_php. Upon testing the installation on IndicHosts server, an error '500 Internal Server Error" is observed on the web browser.
Common sources of the issue are:
Reason & Background: As our server runs Apache with suPHP and does not use mod_php, PHP scripts are executed as 'username' instead of 'apache' or 'nobody'. Hence, all your script files and subdirectories need to be owned by the username. In addition, most of the script's documentation is focused towards basic LAMP (Linux, Apache, MySQL, PHP) with mod_php deployments. The script's documentation recommends that certain directories and files should be set to world writable (i.e. 777 or 666.). Often, PHP files, as part of a source archive, are distributed with executable permissions of 777 or 775.
On IndicHosts servers, you should NOT have any world writable files or directories (with permission levels such as 0777, 0666, 0770, 0660, etc.). Our PHP script files (.php) should NOT be executable (with permission levels such as 0755) even if the official script documentation recommends it. This is a mandatory security requirement for PHP scripts on IndicHosts' servers.
Hence, to correct the 500 Internal Server Error on the IndicHosts.net server, you need to do the following:
chmod 755 directory
chmod 644 filename.php
robert:robert
. You can fix this by running this command in cPanel >> Terminal >> (If you don't have terminal enabled, raise a ticket and ask us to enable terminal on your domain)chown username:username directory
chown username:username filename.php
Once you have rectified the above, refresh the script URL. If the error persists, please raise a ticket with the script details.
Tip: the error_log file in the script directory shows the exact PHP error behind the 500 internal server error