The message “Call to undefined function name()” says the code called a function that the PHP of this folder does not have. Nearly always it is an extension that is switched off in this PHP version, and you switch it on in Select PHP Version. The start of the function’s name tells you which one.
It is not a function we “disabled”: no PHP function is disabled on this server (see exec and shell_exec). It is a function that was not loaded.
From the function to the extension
| The function starts with… |
Extension to switch on |
| mb_ (mb_strlen, mb_substr) |
mbstring |
| curl_ |
curl |
| imagecreate…, imagejpeg… |
gd (or imagick, for the Imagick class) |
| bcadd, bcmul… |
bcmath |
| gmp_ |
gmp |
| pg_ (pg_connect) |
pgsql. PostgreSQL exists; the module ships switched off. |
| imap_, ldap_ |
imap, ldap |
| mysql_ (mysql_connect) |
None: these functions were removed in PHP 7. The code is old and has to move to mysqli or PDO. See connecting to MySQL from PHP. |
The same goes for “Class not found”: Imagick, ZipArchive, SoapClient and Redis are classes that come from extensions (imagick, zip, soap, redis).
Fixing it, step by step
| 1 |
Note the function name and the file that calls it, both in the message.
|
|
| 2 |
Check which PHP version runs in that folder (see viewing and adjusting your PHP configuration). It is the most common reason for an extension being “on and not on”: you switched it on for one version and the site runs on another.
|
|
| 4 |
Reload the page that gave the error. If it persists, check with a file containing <?php phpinfo(); that the extension shows as loaded.
|
|
Not sure which extension a function belongs to? Look its name up on php.net: each function’s page says which extension it belongs to and from which PHP version it exists. It is safer than switching extensions on blindly. And if the extension is not in the list for that PHP version, try another version; an application that demands an extension the account does not offer is a case for a VPS.
|
A missing extension can be code that is too old. If the function vanished from PHP itself (as with mysql_*, and each() and create_function() in PHP 8), no box brings it back. Update the application or, until you can, use an older PHP version for that folder only.
|
|
Switched the extension on and the function is still missing? Send us the message, the folder and the PHP version.
Open a support ticket
|
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon) See plans |