Secure your php

VPS and dedicated server security tips. Preventing from attacks, ddos and more.

Secure your php

Postby Mark » Tue Dec 22, 2009 5:33 pm

PHp security is most important. You need to disable few features that are enabled by default and could be harmful for your data and server.


First we need to locate the php.ini file.
php -i | grep php.ini


For cPanel the correct file is /usr/local/lib/php.ini. The standard location for most other servers is /etc/php.ini. Go ahead and open the php.ini file.



nano /etc/php.ini



Scroll down until you see "disabled_functions" ;. Go ahead and comment the line out with a ";" and replace it with the following:

disable_functions = "system,exec"


Now go ahead save and restart apache. To change what is disabled simply remove the function that you want to be running. In my opinion the most important functions to keep disabled are the system and exec functions as they tend to cause the most problems and are used for many php exploits.
Mark
 
Posts: 124
Joined: Fri Dec 11, 2009 2:18 pm

Return to Securing your server

Who is online

Users browsing this forum: No registered users and 1 guest

cron