突然想往php种增加个模块,可是又不想重新编译php,因为真的比较费时间。
phpize就可以解决这个问题。
cd到php的源代码目录,进入ext。
比如我的工作当做就需要追加mysqli模块,进入mysqli目录。
[vagrant@rs-1 mysqli]$ pwd
/home/vagrant/download/php-5.5.11/ext/mysqli
执行phpize, 咦,报错了!!
[vagrant@rs-1 mysqli]$ phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
google了下,解决方法如下:安装autoconf
[vagrant@rs-1 mysqli]$ sudo yum install autoconfig
[vagrant@rs-1 mysqli]$ phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
发现在当前目录下生成了 configure文件。
执行configure
[vagrant@rs-1 mysqli]$ ./configure --with-php-config=/usr/local/bin/php-config --with-mysqli=/usr/bin/mysql_config
[vagrant@rs-1 mysqli]$ sudo make && sudo make install
[root@rs-1 ext]# ll
total 152
drwxr-xr-x 3 root root 4096 May 9 05:09 date
drwxr-xr-x 2 root root 4096 May 9 05:09 dom
drwxr-xr-x 3 root root 4096 May 9 05:09 ereg
drwxr-xr-x 2 root root 4096 May 9 05:09 filter
drwxr-xr-x 2 root root 4096 May 9 05:09 hash
drwxr-xr-x 2 root root 4096 May 9 05:09 iconv
drwxr-xr-x 2 root root 4096 May 9 05:09 json
drwxr-xr-x 2 root root 4096 May 9 05:09 libxml
drwxr-xr-x 4 root root 4096 May 9 05:09 mbstring
drwxr-xr-x 2 root root 4096 May 9 07:32 mysqli
drwxr-xr-x 3 root root 4096 May 9 05:09 pcre
drwxr-xr-x 2 root root 4096 Apr 29 13:07 pdo
drwxr-xr-x 2 root root 4096 May 9 05:09 phar
drwxr-xr-x 2 root root 4096 May 9 05:09 session
drwxr-xr-x 2 root root 4096 May 9 05:09 sockets
drwxr-xr-x 2 root root 4096 May 9 05:09 spl
drwxr-xr-x 3 root root 4096 Apr 27 15:11 sqlite3
drwxr-xr-x 2 root root 4096 May 9 05:10 standard
drwxr-xr-x 2 root root 4096 May 9 05:10 xml