The Website and the assigned APP-Pool are running with an local administrator account
Give Everyone permissions to execute cmd.exe
Copying the cmd.exe to the same folder where the .php File is.
I hope you rollbacked these "security hole award" settings already...
All you need is to give read & execute permissions to the application pool identity (NTFS) and the execution permission to the handler mapping (http://technet.microsoft.com/en-us/library/cc725855%28v=ws.10%29.aspx)
Then, either you specify the full path to cmd.exe in your code, or you'll have to copy cmd.exe in you PHP directory.
This message is provided "AS IS" with no warranties, and confers no rights!
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
SimonDe
1 Post
Access cmd via PHP
Dec 11, 2012 07:44 PM|LINK
Hi there
I try to access the command line via PHP (5.4.9) on my Server 2008 R2. When i run the following php code:
<?php $result = 0; $resultstr = system('echo %PATH%', $result); echo $resultstr; ?>When i execute the code i got: PHP Warning: system(): Unable to fork [echo %PATH%]
I already tried these things:
Does anyone know a solution for my problem?
Thanks very much :)
Regards,
Simon
fab777
925 Posts
Re: Access cmd via PHP
Dec 13, 2012 08:39 AM|LINK
Hi,
I hope you rollbacked these "security hole award" settings already...All you need is to give read & execute permissions to the application pool identity (NTFS) and the execution permission to the handler mapping (http://technet.microsoft.com/en-us/library/cc725855%28v=ws.10%29.aspx)
Then, either you specify the full path to cmd.exe in your code, or you'll have to copy cmd.exe in you PHP directory.
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI