This guide explains how to install the Suhosin PHP protection security patch on Linux. Open-source applications are widely used online, making their security crucial for developers, providers, and users. Suhosin is highly recommended for safeguarding PHP applications, offering advanced protection against exploits and vulnerabilities in PHP installations, and shielding servers from various attacks.
How to install Suhosin under different Linux Distributions? (RHEL / CentOS / Fedora)
- Download the latest version of Suhosin, and enter the following command for that purpose:
# cd /opt # wget http://download.suhosin.org/suhosin-0.9.32.1.tgz
NOTE: You must ensure that php-devel is installed:
# yum install php-devel
- Then Compile Suhosin under PHP and RHEL / CentOS Linux using the below commands:
# cd suhosin-0.9.32.1 # phpize #./configure # make # make install
- Configure Suhosin onto the server, using the below command a configuration file of Suhosin will be created:
# echo 'extension=suhosin.so' > /etc/php.d/suhosin.ini
- Using the below command you must not restart the server:
# service httpd restart
NOTE: In case you have lighttpd activated on the server, you must use the below command to restart it:
# service lighttpd restart
- Now you must recheck whether Suhosin has been installed on the server. Using the below command, you may do so:
$ php -v
NOTE: You may run the following command to check for more details
<?php phpinfo(); ?>
That’s it! For additional assistance, check out our Knowledge Base section.