500 Internal Server Error – Explained and Solved

internal_errorWhat is the 500 Error?

Put simply, the 500 error is what we call a “server-side” error. That means that there is something wrong with the server who is hosting the website. It is an extremely general error usually caused by configuration issues with the websites programming, PHP or system permissions.

What causes 500 Internal Server Errors?

500 errors can frequently occur with incorrectly configured rewrite rules contained in your .htaccess file.

Fixing the 500 Internal Server Errror

If you’ve recently made changes to your PHP Melody file structure or applied an update package, please review your current .htaccess file.

If this file was overwritten recently, please review your previous .htaccess file for any extra lines. Perhaps your server requires those additional lines.

How to find out if .htaccess is the problem?

Simple. Rename your existing .htaccess file into .htaccess-bk and see if that removes the 500 internal error.

This may not be the only problem so, if renaming the .htaccess file doesn’t get rid of the error, here a few other options:

  • Review your error_log file for any errors. Those error messages usually include more details about what exactly is wrong with the server.
  • Make sure that your Smarty/templates_c/ directory’s permissions are set to 777 (chmod 0777).
  • Report the problem to your hosting provider. Most likely the hosting company can easily sort such problems for you
  • Contact our support team. We’re ready to help with any problems (even server issues). To speed things up, include FTP credentials to your installation.

Can’t add any ‘classic ads’. Internal Error 500.

If creating or saving ads in PHP Melody returns an ‘Internal Error 500’ message, your hosting provider has a restrictive ‘mod_security’ configuration.

There are several things which you can do to fix circumvent this problem.

Option 1

Call or live chat with your hosting provider and ask them to disable ‘mod_security’ for your hosting account. GoDaddy is known not to help in this case and simply play dumb. You’ll be wasting your time with them on this issue. Other hosting providers are more helpful and cooperative.

Option 2

Try disabling ‘mod_security’ yourself via .htaccess.

Open .htaccess and add these lines at the end of the file:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Or in some cases this might also work:

<IfModule mod_env.c>
SetEnv MODSEC_ENABLE Off
PassEnv MODSEC_ENABLE
</IfModule>

Note: this method will not work with mod_security2 or on GoDaddy accounts.

Option 3

If you have your own server you can edit your ‘mod_security’ config file and white-list some PHP Melody files.

Locate and open your mod_security config file. In this case, the config file was found at: /usr/local/apache/conf/modsec2/whitelist.conf

Add the following lines:

<LocationMatch "/admin/ad_manager.php">
SecRuleRemoveById 300015 300016 300017
</LocationMatch>
<LocationMatch "/admin/admin-ajax.php">
SecRuleRemoveById 300015 300016 300017
</LocationMatch>
<LocationMatch "/admin/prerollstatic_ad_manager.php">
SecRuleRemoveById 300015 300016 300017
</LocationMatch>

Option 4

If everything fails, you can quickly insert the ads code via phpMyAdmin. Browse to your PHP Melody database, select the ‘pm_ads’ table and in the ‘code’ field of your desired ad zone add the HTML code provided by your ad partner.

You can also add banners manually by editing your theme files.

Good luck!