使用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数据库,所以需要 ...
随机推荐
- shell 字符串截取
${expression}一共有9种使用方法. ${parameter:-word},如果parameter为空,则用word的值做parameter的缺省值 ${parameter:=word},在 ...
- 【Codeforces 723D】Lakes in Berland (dfs)
海洋包围的小岛,岛内的有湖,'.'代表水,'*'代表陆地,给出的n*m的地图里至少有k个湖,求填掉面积尽量少的水,使得湖的数量正好为k. dfs找出所有水联通块,判断一下是否是湖(海水区非湖).将湖按 ...
- 【2016 ACM/ICPC Asia Regional Qingdao Online】
[ HDU 5878 ] I Count Two Three 考虑极端,1e9就是2的30次方,3的17次方,5的12次方,7的10次方. 而且,不超过1e9的乘积不过5000多个,于是预处理出来,然 ...
- 【POJ 1679】The Unique MST(次小生成树)
找出最小生成树,同时用Max[i][j]记录i到j的唯一路径上最大边权.然后用不在最小生成树里的边i-j来替换,看看是否差值为0. #include <algorithm> #includ ...
- nhibernate 配置nvarchar(max)
若你真的需要一个nvarchar(max)的sql存储空间时,记得增加 .CustomType("StringClob") Demo:Map(x => x.ContentM ...
- [学习笔记]tarjan求割边
上午打模拟赛的时候想出了第三题题解,可是我不会求割边只能暴力判割边了QAQ 所以,本文介绍求割边(又称桥). 的定义同求有向图强连通分量. 枚举当前点的所有邻接点: 1.如果某个邻接点未被访问过,则访 ...
- Leetcode 221. Maximal Square
本题用brute force超时.可以用DP,也可以不用. dp[i][j] 代表 以(i,j)为右下角正方形的边长. class Solution(object): def maximalSquar ...
- 【BZOJ-2286】消耗战 虚树 + 树形DP
2286: [Sdoi2011消耗战 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 2120 Solved: 752[Submit][Status] ...
- ZooKeeper分布式集群安装
我特意选择了稳定版...... 奇数意思是说奇数和偶数对故障的容忍度是一致的....所以建议配置奇数个,并不是必须奇数... 一.master节点上安装配置 1.下载并解压ZooKeeper-3.4. ...
- WinRAR命令行
用法: rar <命令> -<开关 1> -<开关 N> <压缩文件> <文件...> <@列表文件...> <解压路径\ ...