标签:ret root ext ofo nload cli release make phpize
php安装suhosin扩展suhosin-0.9.38 支持到php 5.4
php5.4 5.5 5.6 需安装 https://github.com/sektioneins/suhosin
php 7.X版本需安装 https://github.com/sektioneins/suhosin7
#> cd suhosin
#> phpize
#> ./configure
#> make
#> make install
目前yum安装的php版本为5.4.16,可直接下载suhosin-0.9.38
[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查看有没有加载成功:
[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
标签:ret root ext ofo nload cli release make phpize
原文地址:http://blog.51cto.com/11975865/2347312