User Tools

Site Tools


php:harden_php

This is an old revision of the document!


PHP - Harden PHP

Edit the php.ini file:

sudo vi /etc/php5/apache2/php.ini

Add or edit the following lines an save:

/etc/php5/apache2/php.ini
disable_functions = exec,system,shell_exec,passthru
register_globals = Off
expose_php = Off
display_errors = Off
track_errors = Off
html_errors = Off
magic_quotes_gpc = Off
mail.add_x_header = Off
session.name = NEWSESSID

Restart Apache server. Open a Terminal and enter the following:

sudo service apache2 restart
php/harden_php.1468332498.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki