|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67088 exec expect a carriage return
Submitted: 2014-04-16 17:23 UTC Modified: 2021-03-21 04:22 UTC
From: jakoch at web dot de Assigned: cmb (profile)
Status: No Feedback Package: Program Execution
PHP Version: 5.4.27 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
15 + 2 = ?
Subscribe to this entry?

 [2014-04-16 17:23 UTC] jakoch at web dot de
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:

Test script:
$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>";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-09 13:58 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-03-09 13:58 UTC]
I cannot reproduce this (PHP 7.4, IIS 10).  Is this still an issue
for you with any of the actively supported PHP versions[1]?

[1] <>
 [2021-03-21 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 07:03:38 2023 UTC