PHP使用phpize安装expect扩展

来源:互联网 发布:网络机顶盒看不了电视 编辑:程序博客网 时间:2024/06/06 02:58

1.安装tcl、expect

2.下载expect的php extension

3.安装expect的php extension

(1)cd 扩展目录

(2)/home/users/gaozhanhua02/php/bin/phpize

(3)./configure --prefix=/home/users/gaozhanhua02/php/self-extension/ --with-php-config=/home/users/gaozhanhua02/php/bin/php-config --with-expect=/home/users/gaozhanhua02/expect/ --with-tcldir=/home/users/gaozhanhua02/tcl/lib/

(4) vim Makefile,在CPPFLAGS中增加

-I/home/users/gaozhanhua02/tcl/include -I/home/users/gaozhanhua02/expect/include

(5)make

(6)make test

(7)make install

注意:最初我使用的expect extension版本是expect-0.3.1,php版本是5.2.17,在安装完扩展后重启php的时候出现段错误,gdb调试发现错误为“in TclSetupEnv () from /usr/lib64/libtcl8.4.so”通过google找到一篇文章(https://www.centos.org/forums/viewtopic.php?f=20&t=22151&sid=39f363eae70b21ca162656a357926984)说0.3.1需要php版本5.3及以上,由于5.3的php版本是在2009年发布,于是我将expect extension的版本改为0.2.6,重新编译安装就成功了


原创粉丝点击