使用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数据库,所以需要 ...
随机推荐
- 使用AOP 实现多数据源 切换
多数据源的实现,这里就来个实例吧 1.在 spring 的配置文件中数据源信息 <?xml version="1.0" encoding="UTF-8"? ...
- C#-黑客-数据库访问-字符串的攻击和防御
C#中用基本的方法对数据库进行增删改查,会被黑客利用,写入其他的代码以实现对数据库的数据进行其他的操作.例如: 对下列数据库的某个信息进行修改操作 修改代码: using System; using ...
- 新手该学习Python2.x版本还是3.x版本
如果你是一个初学者,或者你以前接触过其他的编程语言,你可能不知道,在开始学习python的时候都会遇到一个比较让人很头疼的问题:版本问题!!是学习python2 还是学习 python3 ?这是非常让 ...
- 【BZOJ-1017】魔兽地图DotR 树形DP + 背包
1017: [JSOI2008]魔兽地图DotR Time Limit: 30 Sec Memory Limit: 162 MBSubmit: 1566 Solved: 705[Submit][S ...
- CameraFlash手电筒
有时候晚上找不到电棒,电灯,咱们可以写个小程序,利用照相机的闪光灯临时顶替上代码: 1 package com.linux.cameraflash; import android.hardware.C ...
- app基本信息
1.获取设备信息 NSLog(@"设备名称:%@",[[UIDevice currentDevice] systemName]); NSLog(@"版本号:%@" ...
- Sender
多个对象用同一个方法的时候,想对多个对象分别操作的话就用Sender. BackGroundWorker worker1 = sender as BackGroundWork. 分别去取当前的对象 ...
- Android知识体系图
网上看到,不知哪位大神总结的,存个档(需要放大网页才能看清)
- Java多线程实践
1.实现Runnable接口 import java.util.Random; public class PrintTask implements Runnable{ private final in ...
- Beta版本——第七次冲刺博客
我说的都队 031402304 陈燊 031402342 许玲玲 031402337 胡心颖 03140241 王婷婷 031402203 陈齐民 031402209 黄伟炜 031402233 郑扬 ...