Bug #67088 [Opn->Fbk]: exec expect a carriage return

From: Date: Tue, 09 Mar 2021 13:58:33 +0000
Subject: Bug #67088 [Opn->Fbk]: exec expect a carriage return
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232639@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67088&edit=1

 ID:                 67088
 Updated by:         cmb@php.net
 Reported by:        jakoch at web dot de
 Summary:            exec expect a carriage return
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Program Execution
 Operating System:   Windows
 PHP Version:        5.4.27
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

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] <https://www.php.net/supported-versions.php>


Previous Comments:
------------------------------------------------------------------------
[2014-04-16 17:23:32] jakoch at web dot de

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 this bug report at https://bugs.php.net/bug.php?id=67088&edit=1


Thread (3 messages)

« previous php.bugs (#232639) next »