nginx - 关于php模块的动态编译

WBOY
Release: 2016-06-06 20:49:24
Original
992 people have browsed it

写法1: --enable-zip

写法2:--enable-zip=shared

写法1是不是指要静态编译?

写法2是不是指要动态编译?会生成.so文件吗? 如果是的话,它与编译完PHP后,使用phpize命令进模块的增加有什么不同?

回复内容:

写法1: --enable-zip

写法2:--enable-zip=shared

写法1是不是指要静态编译?

写法2是不是指要动态编译?会生成.so文件吗? 如果是的话,它与编译完PHP后,使用phpize命令进模块的增加有什么不同?

原理参考:http://www.walu.cc/phpbook/5.2.md

写法1是静态编译,不会生产so文件;写法2是动态编译,会生产so文件。写法2是编译安装PHP时一起做的,实质结果和phpize仍然是一样的,同样要修改ini文件显示的配置扩展so。但是,写法2有几个相关的问题:

  1. 官方PHP发行源代码中不一定包含你需要的扩展源代码,因此你不能直接enable或with,如果要这样做则需要删除原理的configure文件并拷贝扩展源代码到ext目录,然后./buildconf --force重新生成configure文件
  2. 否则,如果官方PHP发行源代码中没包含你需要的扩展源代码你也没要一定要静态编译的方式安装,则有2个选择:一是如果支持pecl命令安装,则直接用pecl命令安装;如果扩展不支持pecl安装,才自己使用phpize何php-config命令编译安装

关于两种安装方式的区别,前面提到的网站中有相关的说明,主要是静态编译是直接将扩展编译到PHP主程序中了,其扩展调用的步骤不动态编译方式要简单,有利于提高性能。但是,大部分时候,这点性能应该是可以忽略的了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!