How to Disable PHP Exec

PHP Exec(), or simply PHP Exec, is a function that exists in the PHP engine; it enables PHP code to be executed by a script. The PHP Exec function may be exploited by malware and hackers. However, you can disable PHP Exec from within the PHP.ini file at the root of the PHP site. By configuring the PHP.ini file for particular PHP sites, you can enable PHP Exec when you need it on one web application, while disabling it on another for security purposes.

Instructions

    • 1

      Open an FTP client or file manager to explore the PHP site structure.

    • 2

      Locate the "PHP.ini" file and open the file in a text editor. If using the Windows WSFTP or similar FTP client, click on the PHP.ini file to open in a text editor. If using Ubuntu or a similar Linux-based system, type "sudo gedit PHP.ini" to open the file in the text editor.

    • 3

      Locate the following line in the PHP.ini file:

      disable_functions =

    • 4

      Type the word "exec" (without quotes) after the "=" sign in the PHP.ini file so the statement now appears as "disable_functions = exec."

    • 5

      Save the file by clicking "File" from the top navigation bar, and then clicking "Save."

    • 6

      Restart the Apache web server by typing "apachectl restart" at the Linux command prompt and pressing the "Enter" key.

Related Searches:

Comments

Related Ads

Featured