|
Posted by sunadmn on 10/25/88 11:34
Hey all I have installed the PECL expect module and for the life of me I
can get it to work. Below is a sample script I am running and the error
message I am recieving.
<?php
ini_set ("expect.loguser", "Off");
$stream = popen ("expect://ssh root@rlocalhost uptime", "r");
$cases = array (
array (0 => "password:", 1 => mypass)
);
switch (expect_expectl ($stream, $cases)) {
case PASSWORD:
fwrite ($stream, "password\n");
break;
default:
die ("Error was occurred while connecting to the remote host!\n");
}
while ($line = fgets ($stream)) {
print $line;
}
fclose ($stream);
?>
PHP Fatal error: Call to undefined function expect_expectl() in
/var/www/localhost/htdocs/expect.php on line 10
I installed the PECL like this:
pear install package.xml
and this is my ini file
[expect]
; setup the logfile location
expect.logfile="/var/log/php_expect"
; Log user actions
expect.loguser="1"
; expect timeout
expect.timeout="10"
Can anyone tell me what I might be missing here.
Thanks
Navigation:
[Reply to this message]
|