|  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: -
Avg. Score:4.7 ± 0.7
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.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
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 -scriptblock {& c:\temp\launch.ps1}" <NUL';



exec($command, $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.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 24 14:01:29 2024 UTC