首页 技术 正文
技术 2022年11月19日
0 收藏 330 点赞 2,413 浏览 1987 个字

php5.4 安装扩展demo

php安装suhosin扩展 php版本与suhosin版本:

suhosin-0.9.38 支持到php 5.4

php5.4 5.5 5.6 需安装 https://github.com/sektioneins/suhosin

官方的快速入门

#> cd suhosin
#> phpize
#> ./configure
#> make
#> make install

yum安装的php,安装suhosin扩展步骤:

目前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

yum安装的php5.6 安装5.6版本的php

[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

php7.1 安装扩展

php 7.*  测试版本7.1 7.3版本还不能使用https://github.com/sektioneins/suhosin7 首先通过git在github克隆下来一份到服务器 (suhosin7) 然后cd到目录(suhosin7) #>cd suhosin7

生成配置(少数扩展可能还需要指定其它依赖库的目录,请根据官方说明修改编译参数)

#>/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

注意事项 php7.* 安装完后,写入php.ini扩展的文件不是叫suhosin.so,而是  suhosin7.so (亲自踩坑)这样扩展就安装完成了。。。。如果上面的操作有问题欢迎留言指出。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,020
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,513
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,359
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,142
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,772
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,850