Does this match what you’re seeing?
- Fatal error: Uncaught Error: Call to undefined function
- The error appeared after changing PHP version
- An application reports a missing requirement
PHP was asked to run a function it doesn’t know. There are three possible reasons, and the function name tells you which.
1. The function was removed from PHP
Common after upgrading PHP:
| Function | Removed in | Replacement |
|---|---|---|
mysql_connect(), mysql_query() | PHP 7.0 | mysqli or PDO |
each() | PHP 8.0 | foreach |
create_function() | PHP 8.0 | Anonymous functions |
money_format() | PHP 8.0 | NumberFormatter |
Fix: update the application or plugin. As a temporary measure, switch back to the PHP version it worked on. How to change the PHP version in DirectAdmin
2. An extension isn’t loaded
Functions prefixed by an extension name — mb_, imagecreate, intl, curl_, zip_ — need that extension.
Fix: check whether it’s loaded for your PHP version, and try another available version if not. PHP extensions: how to check what’s available
3. The code that defines it wasn’t loaded
The function belongs to the application itself or a library, but the file defining it wasn’t included — a failed upload, a missing vendor/ folder from Composer, or a plugin whose parent plugin is disabled.
Fix: re-upload the application’s files completely, including vendor/. Deploying a PHP application (Composer, Laravel and frameworks)
Not with Traxio yet? You can try this on a real server with our free PHP hosting trial: 30 days free with no card, then £0.99 a month.