Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 04-05-2009
Member
 
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...
Reply With Quote
  #2  
Old 04-05-2009
Member
 
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
Reply With Quote
  #3  
Old 04-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
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
Reply With Quote
  #4  
Old 04-05-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 12:52 AM.