PHP Warning: shell_exec() has been disabled for security reasons in …

I run the following command in the terminal:

#php /var/www/test.php

Content of test.php file:

shell_exec('date');

result:

PHP Warning: shell_exec() has been
disabled for security reasons in
/var/www/test.php on line 1

The functions are disabled in php.ini, but how can I make an exception for this particular file?


Answer 1, authority 100%

$ php --help

-d foo[=bar] Define INI entry foo with value ‘bar’

Call appropriately:

$ php -d disable_functions= /var/www/test.php

Or make this file executable (chmod +x /var/www/test.php) and write the first line in it:

#!/bin/env php -d disable_functions=

And execute it accordingly simply:

$ /var/www/test.php