473,471 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

expect problems

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
Dec 14 '05 #1
0 1473

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jeff Wagner | last post by:
Is there an Expect-like module for Python that is cross platform and, for the most part, does what Expect does? A number of years ago, I wrote some Tcl scripts using Expect for automation. I am...
0
by: MarkD | last post by:
In regular (tcl) expect the following code waits for the user to enter a password followed by enter and then returns to the script: expect "Password:" #ask user for password and then return to...
0
by: Kevin Cheramie | last post by:
I'm unsure how to break down and use what is returned by expect in the rest of my script. I want to issue a command and split the results of that command into several different variables. I then...
2
by: Mak | last post by:
Hi Everybody, I try set the Expect: 100-continue in my request to server. The way I do it is by setting : <META http-equiv="Expect" content="100-continue"> in my html page. But, it does not...
1
by: Sektor van Skijlen | last post by:
couldn't compile regular expression pattern: quantifier operand invalid while executing "expect -nobrace >|#S {} -re {* } { lappend response_line $expect_out(buffer); exp_continue }" invoked from...
5
by: xinchenvn | last post by:
Hi I'm learning Python. I don't know whether Python can do something like Expect can do. If yes, please show me how to do it. I want to do something automatically: open connection to a ftp...
1
by: graphman | last post by:
I have a perl script that I'm calling using php's shell_exec that uses an expect module to go to another system to pull tiff files. The php perl combination works great when I launch from the...
5
by: kriz4321 | last post by:
I call a EXPECT script from my perl script with machine IP and a FIle. The script logins to the machine and exports the value. I have close to 10 machines and I have created 10 files and pass the...
3
by: bollweevil | last post by:
Hello Everyone, I do Django web development on my Mac at home, and then I rsync the files with the Ubuntu web server. I want to write one single bash shell script that rsyncs the files and...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.