Get your free beta license ↗
Websites · PHP

A site fails with “Call to undefined function exec()”

Last updated 30 Nov 2026
Summary

A site fails with Call to undefined function exec() or the same error for shell_exec, system, passthru, proc_open, or popen. UrbeStack disables those functions by default, and you can allow one in the domain's PHP settings.

Symptoms

The page returns 500 Internal Server Error. Run urbestack-domain-log --name example.com --type php to see the error in the domain's PHP log.

Output
[30-Nov-2026 08:13:53 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function exec() in /home/USER/files/web/example.com/public_html/ex.php:1
Stack trace:
#0 {main}
  thrown in /home/USER/files/web/example.com/public_html/ex.php on line 1

Cause

UrbeStack sets disable_functions to exec,passthru,shell_exec,system,proc_open,popen by default for sites. These six functions let PHP run shell commands.

In PHP 8, a disabled function behaves as if it did not exist, so calling it produces the error in the log. Commands run from the shell or from cron are outside the scope of this setting.

Resolution

  1. To allow the function for this domain, set disable_functions to the list with that function omitted. This command allows exec.

    urbestack-domain-set --name example.com --php-setting disable_functions=passthru,shell_exec,system,proc_open,popen
  2. disable_functions=none allows all six functions. An allowed function lets the site's code run commands as the domain's owner, so allow only what the site needs.

  3. Set an empty value to return to the server's list.

    urbestack-domain-set --name example.com --php-setting disable_functions=