【问题标题】:Error while installing PHP expect extension安装 PHP 期望扩展时出错
【发布时间】:2013-07-24 05:28:21
【问题描述】:

我在 PHP 中安装 expect 扩展时遇到了一些严重错误。

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

我在运行 make 时遇到这样的错误,

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 的初学者。

谢谢。

【问题讨论】:

  • 我猜你需要在你的 Unix 机器上安装 TCL 库:-?
  • 我用这个命令安装了TCL-DEV apt-get install tcl-dev
  • 得到同样的错误!

标签: php expect php-extension pecl


【解决方案1】:

我发现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

【讨论】:

    猜你喜欢
    • 2014-09-20
    • 2016-10-30
    • 2015-12-31
    • 2011-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-03
    • 2016-06-25
    相关资源
    最近更新 更多