How to add a php module through phpize
I. Advantages of phpize
When should we use phpize? When installing 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'
The parameters we follow are the modules we want. but as we need to work, we need to add some modules and don't want to re-compile php. we can use phpize for this.
1. go to the php source code directory.
The following is an example of zip installation.
cd /usr/local/php/include/php/ext/
Ps: The following code can be used to find the ext Directory of the source code php, provided that you do not know
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 execute phpize./configure? With-php-config =/usr/local/php/bin/php-config make install
This will happen after installation.
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/
3. modify php. ini
Vi/usr/local/php/lib/php. ini add a line of extension = zip. so to the place where the module is loaded.
4. restart fpm
Php-fpm restart: kill-USR2 'cat/usr/local/php/var/run/php-fpm.pid'
Over