一,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模块的更多相关文章

  1. phpize增加php模块

    phpize增加php模块 张映 发表于 2010-02-09 分类目录: php 一,phpize的好处 什么时候我们要用phpize呢?我们在安装php时: './configure' '--pr ...

  2. 为nginx增加nginx_http_concat模块

    为nginx增加nginx_http_concat模块 时间 2013-06-05 22:14:56  我行我思 原文  http://www.fanjun.me/?p=562 主题 Nginx 缘由 ...

  3. 给已经编译运行的Apache增加mod_proxy模块的配置方法

    在Linux系统下,需要给已经编译运行的Apache增加mod_proxy模块,可以按照如下方法配置. 具体配置步骤如下: 1. 首先定位到Apache源码的 proxy目录 # cd /root/s ...

  4. nginx增加第三方模块

    增加第三方模块 ============================================================ 一.概述nginx文件非常小但是性能非常的高效,这方面完胜ap ...

  5. Debian 为nginx增加第三方模块

    为nginx增加第三方模块需要重新编译nginx的,但是debian在安装nginx的时候做了很多事情,比如systemd,/etc/nginx/里的各种文件,所以我们最好在debian源代码包的基础 ...

  6. nginx增加新模块

    以gunzip这个模块为例,讲述一下,在nginx中如何安装新的模块 1.首先查看nginx已经安装了哪些模块. nginx –V 2.发现没有gunzip模块,安装 进入nginx的安装目录中,不是 ...

  7. 已经编译安装的nginx/tenginx编译增加新模块

    只适用于自行编译安装的nginx配置 业务变更带来的Nginx增加模块需求 由于业务从php转为go开发,需要用到Http2的协议.这种协议在Nginx上需要http_v2_module这个模块的支持 ...

  8. 平滑增加Nginx模块

    目录 一:平滑增加Nginx模块 1.1.增加模块必须重新编译 一:平滑增加Nginx模块 1.1.增加模块必须重新编译 解决依赖 编译安装不能解决依赖 yum install zlib zlib-d ...

  9. Linux下LANMP集成环境中编译增加pdo_odbc模块

    linux版本为CentOs6.5,php集成环境为lanmp_v3.1,集成环境中默认的pdo扩展为:mysql, sqlite, sqlite2,现在有需求想链接微软的Access数据库,所以需要 ...

随机推荐

  1. 通过lucene的StandardAnalyzer分析器来了解分词

    本文转载http://blog.csdn.net/jspamd/article/details/8194919 不同的Lucene分析器Analyzer,它对TokenStream进行分词的方法是不同 ...

  2. 【USACO 2.1】Healthy Holsteins

    /* TASK: holstein LANG: C++ URL: http://train.usaco.org/usacoprob2?a=SgkbOSkonr2&S=holstein SOLV ...

  3. python 常用内置函数

    编译,执行 repr(me)                          # 返回对象的字符串表达 compile("print('Hello')",'test.py','e ...

  4. (转) Web 建站技术中,HTML、HTML5、XHTML、CSS、SQL、JavaScript、PHP、ASP.NET、Web Services 是什么?

    Web 建站技术中,HTML.HTML5.XHTML.CSS.SQL.JavaScript.PHP.ASP.NET.Web Services 是什么? 建站有很多技术,如 HTML.HTML5.XHT ...

  5. 【BZOJ-4289】Tax 最短路 + 技巧建图

    4289: PA2012 Tax Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 168  Solved: 69[Submit][Status][Dis ...

  6. 【BZOJ-4521】手机号码 数位DP

    4521: [Cqoi2016]手机号码 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 303  Solved: 194[Submit][Status ...

  7. Eclipse中Jquery报错

    在网上看到很多 jQuery-xxx.js 在eclipse中报错的解决方案大多是说 项目右键 Properties->Validation->JSP Content Validator ...

  8. LaTeX test

    \begin{equation} x^2+1=2 \end{equation} \begin{equation} x^2+y=3 \end{equation} $\dfrac{2\pi}{N}$

  9. codevs 1051 接龙游戏(栈模拟)

    传送门 Description 给出了N个单词,已经按长度排好了序.如果某单词i是某单词j的前缀,i->j算一次接龙(两个相同的单词不能算接龙). 你的任务是:对于输入的单词,找出最长的龙. I ...

  10. 用DOS命令打开IE浏览器、我的文档等等

    用DOS命令打开IE浏览器 在“start”-运行中直接输入网址就可以了.如输入百度: http://www.baidu.com Command:[ start  http://www.baidu.c ...