how to enable shell_exec and exec on php? how to enable shell_exec and exec on php? apache apache

how to enable shell_exec and exec on php?


If you are not the root on the machine, and exec() function is disabled, then you can't enable it by yourself.

See http://php.net/manual/en/ini.core.php#ini.disable-functions

disable_functions string

This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.

Only internal functions can be disabled using this directive. User-defined functions are unaffected.

This directive must be set in php.ini For example, you cannot set this in httpd.conf.


You need to disable safe mode in PHP by navigating through \Apache2\bin (not folder) and restart the server.

Check here and here.


remove from function from

disable_functions="" 

in your php.ini file

or if you have Suhosin then check your setting in Suhosin config file under suhosin.executor.func.blacklist