GICT knowledge base
How to Install PHPSuhosin on a Linux VPS
Published
PHPSuhosin
Suhosin (pronounced ‘su-ho-shin’) is an advanced protection system for PHP scripts and the PHP core itself. Suhosin is an open source PHP patch developed for user security and to protect servers against several security flaws and vulnerabilities. Suhosin also protects the server against security flaws in the PHP based applications including WordPress, Joomla, Drupal, etc….
Install
You must have root access to the server to perform the following install instructions:
1) Login to your server as root user via SSH and make sure that all packages are up to date. You need to enter the below command to update all packages on your server.
yum -y update
2) Install php-devel and its dependencies
CentOS/Fedora
yum install php-devel
Ubuntu/Debian
apt-get install php-devel
3) Download the latest stable Suhosin release from the following URL using ‘wget’
4) Extract the downloaded tar file and change the current working directory to Suhosin
tar -xvf suhosin-0.9.38.tar.gz
cd cd suhosin-0.9.38
5) Perform the below commands one by one to compile Suhosin.
phpize
./configure
make
make install
configure: error: no acceptable C compiler found in $PATH
This is a common error displayed during compilation. The error code itself explains that a C compiler is required to compile Suhosin. If you ever run into this error, please use the following command to install an acceptable C compiler on your server.
CentOS/Fedora
yum install gcc
Ubuntu/Debian
apt-get install gcc
6) Enter the following one-line code to add Suhosin extension to the PHP configuration file.
echo extension=suhosin.so >> /etc/php.ini
The default location for the PHP configuration file is ‘/etc/php.ini’. If the path to PHP configuration file is unknown or a different location, you can easily find it using the following command.
php -i | grep php.ini
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
7) You may create a PHP info page to verify the Suhosin installation. To create a phpinfo file, open a plain text file, add the following lines, and save:
Filename: phpinfo.php
<?php
phpinfo ();
?>
Access the PHP info page using your favorite browser
http://yourdomain.com/phpinfo.php
If you need any further help, please do reach our support department.
Related guides
How to Restrict an SSH Key to One Command
Restrict an SSH key to one command with authorized_keys options. Protect the command and check that unwanted shell and forwarding access are denied.
Linux and CommandsSelf-Hosted Video Processing With FFmpeg: A Practical Guide
Learn how to self-host video processing on a VPS using FFmpeg, with practical commands for conversion, compression, thumbnails, and automated workflows.
Linux and CommandsHow to use nohup: Commands in Linux That Survive Terminal Closes
Keep commands running after you close the terminal. nohup examples with wget, Python, rsync, and Docker on any VPS.
Linux and CommandsHow to Fix “Too Many Open Files” Error on Linux Servers
Learn how to fix the "Too Many Open Files" error on Linux servers by understanding file descriptors, adjusting limits, and diagnosing leaks effectively.
