Suhosin is a PHP security extension that attempts to protect against potential bugs in your application's PHP code.
This extension does not yet support PHP 7.2 or 7.3.
Once the bug in Suhosin for PHP 7 is fixed, to install on PHP 7.X, SSH in to your server as root and install the packages required to build the Suhosin extension.
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
Next, run the following commands on your server:
git clone https://github.com/sektioneins/suhosin7 cd suhosin7 /opt/sp/php7.X/bin/phpize PATH=/opt/sp/php7.X/bin:$PATH ./configure make sudo make install sudo bash -c "echo extension=suhosin.so > /etc/php7.X-sp/conf.d/suhosin.ini" sudo service php7.X-fpm-sp restart
To install this extension on PHP 5.X, SSH in to your server as root and install the packages required to build the Suhosin extension.
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
Next, download Suhosin, extract it, and change to the Suhosin directory. You can find the latest version on the Suhosin downloads page.
wget https://download.suhosin.org/suhosin-0.9.38.tar.gz tar xzf suhosin-0.9.38.tar.gz cd suhosin-0.9.38
Now, compile, install, and restart PHP. To install for multiple PHP versions, repeat the steps below for each PHP version.
/opt/sp/php5.X/bin/phpize PATH=/opt/sp/php5.X/bin:$PATH ./configure make sudo make install sudo bash -c "echo extension=suhosin.so > /etc/php5.X-sp/conf.d/suhosin.ini" sudo service php5.X-fpm-sp restart
You can verify Suhosin is installed correctly by running the command:
phpX.Y-sp -i | grep suhosin
You should see the following output:
/etc/phpX.Y-sp/conf.d/suhosin.ini, suhosin suhosin.apc_bug_workaround => Off => Off suhosin.cookie.checkraddr => 0 => 0 suhosin.cookie.cryptdocroot => On => On suhosin.cookie.cryptkey => [ protected ] => [ protected ] suhosin.cookie.cryptlist => no value => no value suhosin.cookie.cryptraddr => 0 => 0 suhosin.cookie.cryptua => On => On suhosin.cookie.disallow_nul => 1 => 1 suhosin.cookie.disallow_ws => 1 => 1 suhosin.cookie.encrypt => Off => Off ...
To uninstall this extension, as root run the command:
sudo rm /etc/phpX.Y-sp/conf.d/suhosin.ini
Next, restart PHP-FPM with the command:
sudo service phpX.Y-fpm-sp restart