php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61741 exec command running a powershell script cause pwershell's crash
Submitted: 2012-04-16 05:55 UTC Modified: -
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: pierre-eric dot mathez at ceff dot ch Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.3.10 OS: Windows 2008 R2, IIS7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-04-16 05:55 UTC] pierre-eric dot mathez at ceff dot ch
Description:
------------
I've got a PHP script which execute a powershell script. I used PHP version 5.2.x and it is running on IIS 7, Windows server 2008R2. The php package is installed by the web platform installer.

Everything worked fine until I migrate my server to PHP 5.3.10. With this new version, the same command cause a powershell crash. Other person on a french forum has confirm my issue. I think it's a php bug because the operation run well on php 5.2 and not in 5.3.10.
The php script is quite simple, see test script

Test script:
---------------
$command = 'powershell -ExecutionPolicy Unrestricted -command "$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @(\'administrator\',(ConvertTo-SecureString -String \'MyPassword\' -AsPlainText -Force));Invoke-Command -credential $cred -computername 127.0.0.1 -scriptblock {& c:\temp\launch.ps1}" <NUL';

print($command);

print("<br/><hr><br/>");

exec($command, $out);

print_r($out);


Expected result:
----------------
the script execute successful (which is the case on php 5.2.17)

Actual result:
--------------
powershell return an error on Invoke-Command. I should clarify on thing: other scripts with other commands are running well, it's the invoke-command that is not possible to run with this version of php.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 24 09:01:26 2019 UTC