|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-10 10:46 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
Description: ------------ The below php script when run from command prompt runs successfully gives the output returned by perl script. But when run on browser IIS6.0 php (CGI/Fast CGI) I get error. I have pasted the test.php script. the perl script returns a numeric value. Reproduce code: --------------- <?php $cmd="perl uploadpost.pl"; $pipe = popen("$cmd",'r'); while($s = fgets($pipe, 2048)) { $output .= $s; }; pclose($pipe); if (preg_match("/^\d+$/",$output)) { $sid=$output; echo "success.$sid"; }else{ echo "upload failed"; } ?> Expected result: ---------------- Success and $sid some numeric value which is returnes by the perl script Actual result: -------------- Warning: popen(perl uploadpost.pl,r): No error in D:\WFM_vDev_Tk\test.php on line 25 pipe value. Warning: fgets(): supplied argument is not a valid stream resource in D:\WFM_vDev_Tk\test.php on line 27 Warning: pclose(): supplied argument is not a valid stream resource in D:\WFM_vDev_Tk\test.php on line 30 .