一,phpize的好处
什么时候我们要用phpize呢?我们在安装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
后面根的参数是我们要的模块,但是随着工作的需要,我们还要在加些模块,又不想重新编译php,这些我们就可以用phpize了。
二,安装php模块
下面我以mcrypt安装为例子
# cd /root/php-5.2.6/ext/mcrypt #ext目录下面放的是php的模块库
# /usr/local/php/bin/phpize
#确定 php-config 文件在不在,调用php-config,安装后 .so 文件会自动放到 extension_dir 里面
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
安装完后会有这样的东西
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/
# ls -l /usr/lib64/php/modules/
# vi /usr/local/php/lib/php.ini
extension = "mcrypt.so"
三,查看.so文件,以及修改 php.ini
# ls -l /usr/lib64/php/modules/
# vi /usr/local/php/lib/php.ini
extension = "mcrypt.so"
没有评论:
发表评论