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!