|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull Requests | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 09:00:01 2025 UTC | 
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.