|
Posted by graphman on 12/08/06 16:22
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 commandline:
$php docpull.php
I get the files I want. Everything is perfect.
When I run docpull.php through the web server I get to the expect call
in the perl script where the password is passed and the script fails.
No error in any of the logs or return from either php or perl.
I believe that its an environment issue regarding how php is run through
the web server and what the expect module from perl needs for a pty. I
think this is the case because I can see the scp command output that
perl expect is generating gets to the password but after that there is
no error. Expect needs to have a pty to work with and I think that when
I run through the command line I have one but when I run through apache
I lose access to ptys.
Permissions don't seem to be a problem because I've set up all of the
directories involved with uncomfortably open perms and I've run the
command line version as the Apache user.
I'm reaching at this point. Because of another server limitation I'm
stuck with php 4 and Apache 1.3 for the time being. If anyone has any
other suggestions for pulling files from a remote server I'd be happy to
give them a try, however, the scp with expect will solve lots of other
problems I'll have to deal with.
I'm on slackware linux 10.2
Apache/1.3.33 (Unix)
PHP 4.4.1 (cli) (built: Dec 21 2005 03:44:49)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with Xdebug v2.0.0beta5, Copyright (c) 2002, 2003, 2004, 2005, by
Derick Rethans
This is perl, v5.8.7 built for i486-linux
The expect module I'm using is Expect-1.20
[Back to original message]
|