Disable suhosin on the server using php.ini or .htaccess files

Sunday, 30. October 2011

If you ever wanted to disable certain Suhosin settings at a domain level, these 2 methods may be of help to you

Disable suhosin Using php.ini file

1) Login to the server as root and copy php.ini file to the root folder of the domain in question. Usually, this command should work for you.

[[email protected]]# cp /usr/local/lib/php.ini /home/<username>/public_html

2) Open the php.ini file and add the following code to the file:

; Misc Options
suhosin.simulation = On
#On = Disabled, Off  = Enabled

3) Save and quit the file. Restart apache.

Disable suhosin Using .htaccess file

1) Locate and open the .htaccess file of the domain in question – possibly via FTP or CMD.

2) Now enter the following code in the file.

php_flag suhosin.simulation On

If suphp is in action on the server, you may also need to add this to your .htaccess.

<Files ".ht*">
deny from all
suPHP_ConfigPath /home/username

4) Save and quit the file. Restart apache.