Friday, 28 February 2014

solution to installation of expect module in php5

following message will come if php expect module didn't find on web server expect example page.

fopen(): Unable to find the wrapper "expect" - did you forget to enable it when you configured PHP?

This means is not there in /usr/lib/php5/extensions

to install expect module  follow streps :

1.   Before installation install dependencies  : expect-devel, tcl-devel packages

2. run following command to build and install expect module

pecl install channel://

It will create /usr/lib/php5/extensions/ file

3. Now add config file for php in /etc/php5/conf.d/expect.ini

cat > /etc/php5/conf.d/expect.ini  << END
; comment out next line to disable mysqli extension in php

4. Now check php modules  by following command:

php -m   

 If you get following error  :

1   /usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: cannot find -lexpect
/usr/lib/gcc/i586-suse-linux/4.7/../../../../i586-suse-linux/bin/ld: cannot find -ltcl
collect2: error: ld returned 1 exit status
make: *** [] Error 1
ERROR: `make' failed

for that  go to /usr/lib/ 

ln -s libexpect<version>.so
ln -s libtcl<version>.so

( <version> : is the version number of the package )

Share This!

1 comment:

Here We Write The Problems we face at different situations and Solutions to those problems.