Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got some serious error while installing expect extension in PHP.

I ran sudo pecl install channel://

I got error like this while running 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

Please advice me as I am a very beginner in PHP.


share|improve this question
Which OS/Distro have you using? – ALex_hha Jul 24 '13 at 5:55
Ubuntu 12.04 64 bit – Uvais Ibrahim Jul 24 '13 at 6:00

You should install expect-dev.

sudo apt-get install expect-dev
share|improve this answer

You need to install tcl-dev

# apt-get install tcl-dev

It's my fault, the tcl.h is provided in tcl8.4-dev/tcl8.5-dev

tcl8.4-dev: /usr/include/tcl8.4/tcl.h
tcl8.5-dev: /usr/include/tcl8.5/tcl.h

You can find which package contain tcl.h with apt-file

# apt-file search tcl.h
share|improve this answer
Still I am getting the same error ! – Uvais Ibrahim Jul 24 '13 at 6:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.