Bug #67088 [NEW]: exec expect a carriage return
From: jakoch at web dot de
Operating system: Windows
PHP version: 5.4.27
Package: Program Execution
Bug Type: Bug
Bug description:exec expect a carriage return
Description:
------------
Calling "powershell" via "exec" hangs, when called in browser context.
The same call works on CLI.
Why is a prior echo'ing needed to get it working in the browser?
Issue solved with the workaround provided here:
http://www.php.net/manual/fr/function.exec.php#110617
Test script:
---------------
<?php
$output = array();
$return_code = 0;
// hangs in browser, but works on CLI
exec('powershell "New-Object -com WScript.Shell | Get-Member"',
$output);
// works (in browser and on CLI)
//exec('echo . | powershell "New-Object -com WScript.Shell |
Get-Member"', $output);
echo "<pre>";
foreach($output as $line) {
echo $line . PHP_EOL;
}
echo "</pre>";
--
Edit bug report at https://bugs.php.net/bug.php?id=67088&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67088&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67088&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67088&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67088&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67088&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67088&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67088&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67088&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67088&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67088&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67088&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67088&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67088&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67088&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67088&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67088&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67088&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67088&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67088&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67088&r=mysqlcfg
Thread (3 messages)
- jakoch at web dot de