Linux uses phpize to quickly extend php modules

 

One, the benefits of phpize


When should we use phpize? When we install php:

# ./configure --prefix=/usr/local/php  --enable-fpm --enable-fastcgi --enable-ftp --with-mcrypt --enable-mbstring --with-curl --with-iconv --with-gettext --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql=/usr/local/mysql --with-mysqli --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-openssl --enable-xml --disable-rpath --with-freetype-dir=/usr

The parameters of the root behind are the modules we want, but with the needs of the work, we have to add some modules, and don't want to recompile php, we can use phpize for these.



Second, install the php module


Below I take mcrypt installation as an example

# cd /root/php-5.2.6/ext/mcrypt #The php module library is placed under the ext directory
# /usr/local/php/bin/phpize #Make
sure the php-config file is in No, call php-config, the .so file will be automatically placed in extension_dir after installation
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
After installation there will be something like this

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'.

# make install 
Installing shared extensions: /usr/lib64/php/modules/


Third, view the .so file and modify php.ini


# ls -l /usr/lib64/php/modules/



# vi /usr/local/php/lib/php.ini

extension = "mcrypt.so"

Fourth, restart apache or phpcgi or other



 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326615058&siteId=291194637