exec(PERL) winNT IIS hanging

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

exec(PERL) winNT IIS hanging

Post by rxsid »

Hi all,

Using PERL 5.6.1.631, PHP 4.3.1, win NT4.0 & iis webserver.

Trying to call a PERL script from within my PHP script. The PERL script works find from the command line, but causes the browser (I.E.) to hang if called by the PHP web script.

tried with path to perl executable:

Code: Select all

exec("C:\\Perl\\ntt\\perl.exe C:\\pathto\\PERLscript\\test.pl");

[\php]

also tried

Code: Select all

exec("start C:\\pathto\\PERLscript\\test.pl");

[\php]

And several other flavors, but can't get the script to execute.  The perl binary & path & script has iis guest internet user permissions set to full control.  So full paths are being indidated, and the binaries/paths/code has full permissions.

Any ideas why my call to the PERL script would be hanging?

Thanks for any help/suggestions!
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

tried with a hello-world perl script? e.g. does it execute the script at all?
What happens if you execute the php script from command line, does it still hang?
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

Post by rxsid »

this is the perl script which works just fine from the command line:

Code: Select all

$filetest = "testingFile.txt";

open(THISTEST, ">>I:\\path\\to\\$filetest");
print THISTEST "TESTING";
close (THISTEST);
but when called from a php script, the browser just hangs and hangs.
qartis
Forum Contributor
Posts: 271
Joined: Sat Dec 14, 2002 4:43 pm
Location: BC, Canada
Contact:

Post by qartis »

Have you tried the other flavours of executing system commands? Namely..

Code: Select all

system("command");
passthru("command");
`command`; /* Those are backticks */
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

since the script deals with file I/O i suspect permission issues..

Again: Does a hello world script work?
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

Post by rxsid »

I have tried system() & passthru(), and yes i've tried the simple Hello World.

All the above cause the browser to hang.
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

ok, if a hello world cause the browse to hang it is obveius that the permission requirements to execute the perl intepreter from PHP is not met.

Using the hello world perl script called from a PHP script, if you execute the PHP script from command line, what happens?
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

Post by rxsid »

thanks for the pointers Stoker, I've finally got it working.

1st: The file type .pl or .cgi wasn't properly setup in the windows file extension list.

2nd: I was missing a perl100.dll, which I happened to have in an older (backed up) perl installation. So I just copied that dll into the dir where the perl executable is.

Calling PERL scripts from PHP web scripts now work.

Thanks.
Post Reply