hello friends,
I want to disable the use of exec() function in PHP. Is it possible to disable the exec() function in PHP? If possible, How can I do the same ?
any ideas...
hello friends,
I want to disable the use of exec() function in PHP. Is it possible to disable the exec() function in PHP? If possible, How can I do the same ?
any ideas...
You can disable certain functions in PHP for the security reasons -
For disabling exec() funtion,
- Open php.ini file: # vi /etc/php.ini
- Find disable_function: disable_functions = exec
- Save and close the file. Restart httpd: # service httpd restart
Yes, you can disable the exec funvtion in your php.ini.
Search for the line => disable_functions =
and change it to => disable_functions = exec
You will need to disable some php functions when dealing with the security of your server. You can easily do this by already mentioned above solns. But on shared hosting, the only problem is that you cannot disable exec for a domain.
There is a solution to this and it’s called suhosin.
Suhosin has a configuration variable called ”suhosin.executor.func.blacklist” which can be used to disable some php functions. The difference between this variable and disable_functions in php.ini is that it can be set for all the sites and then it can be modified for a domain only (it can be overwritten) so you will be able to disable exec on the entire server and enable that function for a single domain.
Bookmarks