Applicable to:
- Plesk for Linux
Symptoms
An error like this one appears in Domains > example.com > Logs, or on the website
Note: <function_name>
is a placeholder and will be different in the actual error
Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function <function_name>() in /var/www/vhosts/example.com/httpdocs/test.php:3\nStack trace:\n#0 {main}\n thrown in /var/www/vhosts/example.com/httpdocs/test.php on line 3'
Cause
The PHP function from the error is disabled in php.ini
Resolution
Warning: These steps don't work with PHP-FPM (global settings override them); they only apply to FastCGI.
Enable the disabled functions in the PHP configuration.
-
Log in to Plesk
-
Go to Domains > example.com > PHP Settings
-
Remove the desired function from disable_functions
-
Press OK
If there's no section called disable_functions, add disable_functions=""
to Additional directives instead.
-
Log in to Plesk
-
Identify the affected PHP handler in Domains > example.com > PHP
-
Go to Tools & Settings > PHP Settings > Affected PHP version > php.ini
-
Find
disable_functions
and remove the function from the error -
Press OK to save the changes
-
Connect to the server over SSH
-
Identify the affected PHP handler with this command
Note: Replace
example.com
with the website from the error# plesk db "SELECT d.name,h.php_handler_id FROM domains d JOIN hosting h on h.dom_id=d.id WHERE name='example.com'"
-
Edit the handler's
php.ini
Note: Replace X.X with the version from Step 2
# vi /opt/plesk/php/X.X/etc/php.ini
-
Find the line with
disable_functions
and delete the function from the error -
Restart the PHP service:
# service plesk-phpXX-fpm restart
Comments
0 comments
Please sign in to leave a comment.