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:

[suhosin]
; 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

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

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

4) Save and quit the file. Restart apache.

Apache – Stop Apache web service from a command line

Thursday, 11. August 2011

Here is a snappy command to use to stop your apache web service from a command line.

sudo /etc/init.d/apache2 stop