Securing PHP

0
654

Here is some steps on securing your php installation without recompiling php.

Find php.ini file location:

Code:
php -i |grep php.ini

In ubuntu the location is /etc/php5/cli/php.ini

Configure php.ini file:

Code:
nano /etc/php5/cli/php.ini

Find text string in nano editor:
Press and hold CTRL while pressing W key. Then type the string you need to find in php.ini
Enable Safe Mode:

Code:
safe_mode = On

Disable Dangerous PHP Functions:

Code:
disable_functions = dl,system,exec,passthru,shell_exec,wget,curl

Disable Register Globals:

Code:
register_globals = Off

Try using PHPsuexec to prevent nobody group access.

NO COMMENTS

LEAVE A REPLY