Using system() to run a perl command within PHP3

From: Date: Mon, 18 Dec 2000 22:48:29 +0000
Subject: Using system() to run a perl command within PHP3
Groups: php.windows 
Request: Send a blank email to php-windows+get-4532@lists.php.net to get a copy of this message
Hi - I am running PHP4 on Windows2000/IIS5.0 server. I am trying to get a PHP web page to work that calls a perl file, which in turn reads an uploaded file and redirects output to another file. The command is something like this: $importCMD = addslashes(perl THINGY.pl TrainingHist < $userfile > C:\WINNT\Temp\abraerr2.txt); THINGY.pl needs to parse $userfile (an uploaded file) as standard input. The "TrainingHist" part is a command line argument used by THINGY.pl to determine what kind of file it is dealing with. Running THINGY.pl from the command line in this fashion works fine, but as a CGI it only executes part of the code and does not read the $userfile from standard input. I used the addslashes() function to fix the backslash problem in the statment above. These are the two ways I've tried to run the command: $results = system($importCmd, $status); $results = $importCmd; I have also turned on security/object access auditing and do not see any permissions errors on the Win2K side. So I'm really stumped. Any other ideas regarding why this does not work would be appreciated. Thanks so much! Emily

« previous php.windows (#4532) next »