2013-07-24 159 views
1

在PHP中安裝期望擴展時出現了一些嚴重錯誤。安裝PHP期望擴展時出錯

我跑sudo pecl install channel://pecl.php.net/expect-0.3.1

,同時運行使我得到了這樣的錯誤,

running: make 
/bin/bash /tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/libtool --mode=compile cc -I. -I/tmp/pear/temp/expect -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/include -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/main -I/tmp/pear/temp/expect -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/expect/expect.c -o expect.lo 
libtool: compile: cc -I. -I/tmp/pear/temp/expect -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/include -I/tmp/pear/temp/pear-build-rootvXp7LZ/expect-0.3.1/main -I/tmp/pear/temp/expect -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/expect/expect.c -fPIC -DPIC -o .libs/expect.o 
In file included from /tmp/pear/temp/expect/expect.c:21:0: 
/tmp/pear/temp/expect/php_expect.h:33:17: fatal error: tcl.h: No such file or directory 
compilation terminated. 
make: *** [expect.lo] Error 1 
ERROR: `make' failed 

請諮詢我,因爲我在PHP中一個非常初學者。

謝謝。

+0

我猜你需要在你的Unix機器上安裝TCL庫: - ? –

+0

我用這個命令安裝了TCL-DEV'apt-get install tcl-dev' –

+0

並且得到同樣的錯誤! –

回答

2

我發現this對此問題有幫助。 CentOS上我能得到這個通過安裝:

yum install tcl tcl-devel tk tk-devel 
yum install expect expect-devel 
pecl install channel://pecl.php.net/expect-0.3.1 

然後添加以下爲php.ini:

extension = expect.so 
+0

太棒了! 這也適用於我 – sd1sd1