Heim >Backend-Entwicklung >PHP-Tutorial >如何通过phpize增加php模块

如何通过phpize增加php模块

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-20 12:59:491021Durchsuche

一,phpize的好处

什么时候我们要用phpize呢?我们在安装php时:

'./configure' '--prefix=/usr/local/php' '--with-mysql=/usr/local/mysql' '--with-zlib-dir' '--with-freetype-dir=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--with-gd' '--enable-ftp' '--with-iconv' '--with-gettext' '--with-curl' '--enable-fastcgi' '--with-openssl'

后面跟的参数是我们要的模块,但是随着工作的需要,我们还要在加些模块,又不想重新编译php,这些我们就可以用phpize了


1.进入php源码目录

下面我以zip安装为例子


cd /usr/local/php/include/php/ext/

ps: 下边代码可以查找源码php的ext目录在哪,前提是你不知道的话

 find  / -name ext-type d


 wget http://pecl.php.net/get/zip tar -zxvf zip cd zip-1.12.4//usr/local/php/bin/phpize    执行phpize./configure ?with-php-config=/usr/local/php/bin/php-config     make    make install

安装完后会有这样的东西

See any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------Build complete.Don't forget to run 'make test'.Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

三,修改php.ini

vi /usr/local/php/lib/php.ini在加载模块的地加上一行extension=zip.so

四,重启fpm

php-fpm 重启:kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`

over

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php-mvc模式(1)Nächster Artikel:关于分表的问题