suhosin-0.9.38 支持到php 5.4php
php5.4 5.5 5.6 需安裝 https://github.com/sektioneins/suhosinmysql
php 7.X版本需安裝 https://github.com/sektioneins/suhosin7git
#> cd suhosin #> phpize #> ./configure #> make #> make install
目前yum安裝的php版本爲5.4.16,可直接下載suhosin-0.9.38github
[root@php ~]# wget https://download.suhosin.org/suhosin-0.9.38.tar.gz [root@php ~]# tar xf suhosin-0.9.38.tar.gz [root@php ~]# cd suhosin-0.9.38 [root@php suhosin-0.9.38]# phpize #此步驟須要安裝php-devel擴展 #且phpize須要爲須要安裝擴展的php下的phpize Configuring for: PHP Api Version: 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525 [root@php suhosin-0.9.38]# which php-config #php-config爲須要安裝擴展的php下的php-config /usr/bin/php-config [root@php suhosin-0.9.38]# ./configure --with-php-config=/usr/bin/php-config [root@php suhosin-0.9.38]# make && make install
在/etc/php.ini末尾添加extension=suhosin.so,重啓php-fpm便可sql
可以使用php -m | grep suhosin查看有沒有加載成功:ide
[root@php suhosin-0.9.38]# php -m | grep suhosin suhosin
[root@lxk ~]# yum install epel-release [root@lxk ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm [root@lxk ~]# yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm php-common php-devel php-mysql php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof [root@lxk ~]# php-fpm -v PHP 5.6.40 (fpm-fcgi) (built: Jan 9 2019 12:34:41) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
[root@lxk ~]# wget https://github.com/sektioneins/suhosin/archive/master.zip [root@lxk ~]# unzip master.zip [root@lxk ~]# cd suhosin-master/ [root@lxk suhosin-master]# which phpize /usr/bin/phpize [root@lxk suhosin-master]# rpm -qf /usr/bin/phpize #肯定phpize爲要安裝suhosin擴展的php版本 php-cli-5.6.40-1.el7.remi.x86_64 [root@lxk suhosin-master]# phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 [root@lxk suhosin-master]# which php-config /usr/bin/php-config [root@lxk suhosin-master]# rpm -qf `which php-config` #肯定php-config爲要安裝suhosin擴展的php版本 php-devel-5.6.40-1.el7.remi.x86_64 [root@lxk suhosin-master]# ./configure --with-php-config=/usr/bin/php-config [root@lxk suhosin-master]# make && make install [root@lxk suhosin-master]# echo "extension=suhosin.so" >> /etc/php.ini #在配置文件中啓用suhosin.so擴展 [root@lxk suhosin-master]# tail -5 /etc/php.ini ; Local Variables: ; tab-width: 4 ; End: extension=suhosin.so [root@lxk suhosin-master]# systemctl start php-fpm #啓動php-fpm [root@lxk suhosin-master]# php-fpm -m | grep suhosin #查看suhosin擴展是否已加載 suhosin