Thursday, February 12, 2009

Expect, PHP and Ubuntu

here is the Expect installation for PHP on ubuntu
- apt-get install expect
- apt-get install expect-dev
- wget http://pecl.php.net/get/expect-0.2.5.tgz
- pecl install expect-0.2.5.tgz
- vi /etc/php5/conf.d/expect.ini and add the line : extension=expect.so
- restart apache

for other system (fedora in my case), 2 first step is changed to :
- wget http://expect.nist.gov/expect.tar.gz
- tar -zxvf expect.tar.gz
- cd expect-5.43/
- ./configure --with-tclconfig=/usr/lib/tcl8.4 --with-tclinclude=/usr/include/tcl8.4/tcl-private/generic
- make | make install

2 comments:

FariAzz said...

This snippet shows how to run rsync from php, and wait for the rsync password using expect:

http://codenachos.com/view/calling-rsync-from-php-with-password

Anonymous said...

running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

If the command failed with 'phpize: not found' then you need to install php5-dev packageYou can do it by running 'apt-get install php5-dev' as a root userERROR: `phpize' failed

I got this error while running sudo pecl install expect-0.2.5.tgz after installing phpize via "apt-get install php5-dev".

Please advice.

current

last archive