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

Tags: , ,

Sponsored Links



How to disable exec() function in PHP

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 04-05-2009
Member
 
Join Date: Feb 2009
Posts: 47
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
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
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: 1,990
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
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
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


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 2 Weeks Ago 12:51 PM
disable the Print Screen function Figo Windows Security 17 08-11-2011 05:27 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 03:51 PM
exec() function in java Lauren Ambrose Software Development 5 11-03-2010 11:23 AM


All times are GMT +5.5. The time now is 11:22 AM.