phpize's deep understanding

  • 2020-06-03 06:05:12
  • OfStack

Installation (fastcgi mode), often have such words of command: 1 / usr local/webserver php/bin/phpize
1. What does phpize do?
What is phpize? php official note:
http://php.net/manual/en/install.pecl.phpize.php
phpize is used to extend the php extension module. It is possible to build the plug-in module of php through phpize
For example, if you want to add extension modules like memcached or ImageMagick to the original compiled php, you can use phpize to do the following.
2. How to use phpize?
When php is compiled, the phpize script file will be in the bin directory of php. Before compiling the extension you want to add, execute the following phpize;
For example, now you want to add the memcache extension to php: All you need to do is take the following steps
-- -- -- -- -- -- -- -- -- -- -- --
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5/
/usr/local/webserver/php/bin/phpize
. / configure � with - php - config = / usr/local/webserver/php/bin/php - config
make
make install
-- -- -- -- -- -- -- -- -- -- -- --
Note that the path to the es62EN-ES63en file can be specified after./configure
This completes the compilation, all you need to do is add the extension value to the php.ini file
extension = "memcache. so"
---------------------------------------------------------
Note: Cannot find config.m4.
This error is a very silly error, after decompression need cd to folder, otherwise phpize will report an error

Dynamic compilation PHP memcache extension of library, and in the execution/usr/localphp/bin/phpize appear a mistake,
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
Obviously files are missing and need to be installed. I did some research on the Internet.
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz
# cd m4-1.4.9/
# ./configure & & make & & make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure & & make & & make install
Then execute the following command to install
#/usr/local/php/bin/phpize
#. / configure � prefix = / usr/local/memcached � with - libevent = / usr/local/libevent � with - php - config = / usr local/php/bin/php - config
#make & & make install


Related articles: