- Plesk for Linux
WordPress installation in Plesk with WordPress Toolkit fails with the following error message: PHP Fatal error:
PLESK_ERROR: Directive 'magic_quotes_gpc' is no longer available in PHP in Unknown on line 0
The affected domain has set up a PHP 5.4 handler or higher
Plesk bug with ID #PPPM-11170, which will be fixed in future product upgrades.
Note: Consider subscribing to this article in order to get notified when the fix is released or check for the ID in our changelog
As a workaround disable the magic_quotes_gpc as follows:
Note: In this example, we're fixing it for PHP 5.3
Connect to the server via SSH
Perform a backup of the Plesk database as per the instructions here
Execute the following query:
# plesk db "delete from PhpSettingsParameters where name = 'magic_quotes_gpc' and id not in (select dom_param.val from dom_param inner join hosting on (hosting.dom_id = dom_param.dom_id) where param = 'phpSettingsId' and hosting.php_handler_id = 'plesk-php53-fastcgi');"
Note: This will disable the
magic_quotes_gpcdirective globally on all existing domains.
Recreate all the configuration files the following command:
# plesk bin php_settings -u
In order to avoid this issue to repeat on new domains, add this directive to Tools&Settings > PHP Settings > PHP 5.3 > php.ini
CONFIG_TEXT: magic_quotes_gpc = Off
Note: This must be added into [PHP] section