Results 1 to 4 of 4

Thread: How to disable exec() function in PHP

  1. #1
    Join Date
    Feb 2009
    Posts
    52

    How to disable exec() function in PHP

    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...

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to disable exec() function in PHP

    You can disable certain functions in PHP for the security reasons -

    For disabling exec() funtion,

    1. Open php.ini file: # vi /etc/php.ini
    2. Find disable_function: disable_functions = exec
    3. Save and close the file. Restart httpd: # service httpd restart

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: How to disable exec() function in PHP

    Yes, you can disable the exec funvtion in your php.ini.

    Search for the line => disable_functions =
    and change it to => disable_functions = exec

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to disable exec() function in PHP

    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.

Similar Threads

  1. Fix Microsoft Excel function Exec Error
    By Sachi Trivedi in forum MS Office Support
    Replies: 5
    Last Post: 24-01-2012, 12:51 PM
  2. How to disable WAP function on Kp199
    By Mast Maula in forum Portable Devices
    Replies: 3
    Last Post: 10-01-2011, 06:38 PM
  3. How to disable the trackpad button function?
    By L-cynthiya in forum Portable Devices
    Replies: 4
    Last Post: 23-04-2010, 02:51 PM
  4. exec() function in java
    By Lauren Ambrose in forum Software Development
    Replies: 5
    Last Post: 11-03-2010, 11:23 AM
  5. How to disable the CD-ROM autorun function in Windows XP?
    By CheckMeNot in forum Tips & Tweaks
    Replies: 2
    Last Post: 25-12-2008, 09:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,265,636.33388 seconds with 17 queries