使用phpize增加php模块
一,phpize的好处
什么时候我们要用phpize呢?我们在安装php时:
./configure --prefix=/apps/product/php --with-config-file-path=/apps/product/php/etc \
--with-iconv-dir --with-freetype-dir --with-png-dir --with-zlib --with-libxml-dir=/usr \
--enable-xml --enable-discard-path --enable-safe-mode --enable-bcmath \
--enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl \
--with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm \
后面根的参数是我们要的模块,但是随着工作的需要,我们还要在加些模块,又不想重新编译php,这些我们就可以用phpize了。
二,安装php模块
下面我以gd模块安装为例子:
cd /apps/product/php-5.6.10/ext/gd #ext目录下面放的是php的模块库 /apps/product/php5/bin/phpize #确定php-config文件是否存在,调用php-config,安装后.so文件会自动放到extension_dir里面 ./configure --enable-gd --with-php-config=/apps/product/php5/bin/php-config make && make install
安装完后会有这样的东西
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
---------------------------------------------------------------------- Build complete.
Don't forget to run 'make test'. Installing shared extensions: /app/product/php5/lib/php/extensions/no-debug-non-zts-20060613/
三,查看.so文件,以及修改php.ini
cd /app/product/php5/lib/php/extensions/no-debug-non-zts-20060613/ ls -al |grep gd -rwxr-xr-x 1 root root 763334 Feb 9 10:51 gd.so vi /app/product/php5/lib/php.ini 在加载模块的地加上一行extension=gd.so
四,重起phpf服务
查看编译的模块:
/apps/product/php5/bin/php -i|grep configure /apps/product/php5/bin/php -m
php 开启openssl扩展:(当时没测试成功,只能重新编译安装了)
#进入源码目录: cd /usr/local/src/php-7.0./ext/openssl [root@supplier-pre01 openssl]# /usr/local/php7/bin/phpize
Cannot find config.m4.
Make sure that you run '/usr/local/php7/bin/phpize' in the top level source directory of the module [root@supplier-pre01 openssl]# [root@supplier-pre01 openssl]# mv config0.m4 config.m4 [root@supplier-pre01 openssl]# /usr/local/php7/bin/phpize
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
[root@supplier-pre01 openssl]#
[root@supplier-pre01 openssl]# ./configure --with-openssl --with-php-config=/usr/local/php7/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
......
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h [root@supplier-pre01 openssl]# make && make install ---------------------------------------------------------------------- Build complete.
Don't forget to run 'make test'. Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-/ 执行安装后,会提示在某个目录生成.so文件,我生成的位置在/usr/local/php7/lib/php/extensions/no-debug-non-zts-/
打开php.ini,添加下面两句话. vim /usr/local/php7/etc/php.ini
extension_dir = "/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/"
extension=openssl.so
使用phpize增加php模块的更多相关文章
- phpize增加php模块
phpize增加php模块 张映 发表于 2010-02-09 分类目录: php 一,phpize的好处 什么时候我们要用phpize呢?我们在安装php时: './configure' '--pr ...
- 为nginx增加nginx_http_concat模块
为nginx增加nginx_http_concat模块 时间 2013-06-05 22:14:56 我行我思 原文 http://www.fanjun.me/?p=562 主题 Nginx 缘由 ...
- 给已经编译运行的Apache增加mod_proxy模块的配置方法
在Linux系统下,需要给已经编译运行的Apache增加mod_proxy模块,可以按照如下方法配置. 具体配置步骤如下: 1. 首先定位到Apache源码的 proxy目录 # cd /root/s ...
- nginx增加第三方模块
增加第三方模块 ============================================================ 一.概述nginx文件非常小但是性能非常的高效,这方面完胜ap ...
- Debian 为nginx增加第三方模块
为nginx增加第三方模块需要重新编译nginx的,但是debian在安装nginx的时候做了很多事情,比如systemd,/etc/nginx/里的各种文件,所以我们最好在debian源代码包的基础 ...
- nginx增加新模块
以gunzip这个模块为例,讲述一下,在nginx中如何安装新的模块 1.首先查看nginx已经安装了哪些模块. nginx –V 2.发现没有gunzip模块,安装 进入nginx的安装目录中,不是 ...
- 已经编译安装的nginx/tenginx编译增加新模块
只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...
- 平滑增加Nginx模块
目录 一:平滑增加Nginx模块 1.1.增加模块必须重新编译 一:平滑增加Nginx模块 1.1.增加模块必须重新编译 解决依赖 编译安装不能解决依赖 yum install zlib zlib-d ...
- Linux下LANMP集成环境中编译增加pdo_odbc模块
linux版本为CentOs6.5,php集成环境为lanmp_v3.1,集成环境中默认的pdo扩展为:mysql, sqlite, sqlite2,现在有需求想链接微软的Access数据库,所以需要 ...
随机推荐
- jquery-焦点定位追加内容
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- iOS进度条显示
一.实现下载文件进度控制 1.代码示例 1 #import "YYViewController.h" 2 3 @interface YYViewController () 4 @p ...
- python编程关键字
1.常见关键字 (带有操作含义的关键字) for:循环 in:成员比较运算符 if :如果分支 elif:如果分支 else:其他分支 while:循环 def:定义函数 class:定义类 glob ...
- Oracle中通过Job实现定时同步两个数据表之间的数据
1.http://blog.csdn.net/sxdtzhaoxinguo/article/details/41040741 2.Oracle两个数据库定时执行插入: http://zhidao.ba ...
- bzoj 1208 splay模板题2
自己yy了找前驱和后继,学了学怎么删除...(反正就是练模板) #include<iostream> #include<cstdio> #include<cstring& ...
- 【BZOJ-3174】拯救小矮人 贪心 + DP
3174: [Tjoi2013]拯救小矮人 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 686 Solved: 357[Submit][Status ...
- NAnt0.92版本首次在windows 8.1的机子上运行报错的问题解决
在官网上下载的0.92版本,各方面都配置好之后,用命令行运行,却提示报错,如下: 具体的错误提示文字是这样的: 获取ConfigurationFileLocation异常. System.Securi ...
- duxcms SQL Injection In /admin/module/loginMod.class.php
目录 . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述 duxcms是一款采用PHP开发,基于HMVC规则开发适合中小企业.公司.新闻.个 ...
- STM32F207和DM9161A的以太网实现方案
摘要:电力抄表系统常通过网络采集和传输电网中的谐波等信息.本文提出了一种适合电力系统的网络设计方案.在STM32F207和DM9161A为核心的硬件平台上,完成了LwIP协议栈的移植,实现了远程终端和 ...
- iOS设置圆角矩形和阴影效果
1.设置圆角矩形 //设置dropview属性 _dropView.backgroundColor=[[UIColor whiteColor] colorWithAlphaComponent:0.8] ...