#17: Shutting Down Specific Functions

Let's say that you have decided that the exec() function, which allows a PHP script to run commands directly on the server, is too dangerous. You can disable PHP functions individually, locking out the security risks while allowing the rest to run just fine. Here's an example of how to disable a number of functions in your php.ini file:

disable_functions = system, exec, passthru, shell_exec, proc_open

Get Wicked Cool PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.