php安装suhosin扩展 php版本与suhosin版本:php
suhosin-0.9.38 支持到php 5.4mysql
php5.4 5.5 5.6 需安装 https://github.com/sektioneins/suhosingit
官方的快速入门github
#> cd suhosin #> phpize #> ./configure #> make #> make install
yum安装的php,安装suhosin扩展步骤:web
目前yum安装的php版本为5.4.16,可直接下载suhosin-0.9.38sql
[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便可服务器
可以使用php -m | grep suhosin查看有没有加载成功:php7
[root@php suhosin-0.9.38]# php -m | grep suhosin suhosin
yum安装的php5.6 安装5.6版本的phpphp-fpm
[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
生成配置(少数扩展可能还须要指定其它依赖库的目录,请根据官方说明修改编译参数)测试
#>/www/server/php/71/bin/phpize
不知道PATH怎么写能够 which php-config 找到path地址
#>./configure --with-php-config=/www/server/php/71/bin/php-config
编译并安装
#>make && make install
echo "extension = suhosin.so" >> /www/server/php/71/etc/php.ini #说明 若是是7版本的扩展,请把suhosin.so改为suhosin7.so