php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49478 shell_exec does not work
Submitted: 2009-09-06 00:49 UTC Modified: 2009-09-22 20:57 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: elmue at gmx dot de Assigned: pajoye (profile)
Status: Closed Package: Program Execution
PHP Version: 6SVN-2009-09-06 (snap) OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: elmue at gmx dot de
New email:
PHP Version: OS:

 

 [2009-09-06 00:49 UTC] elmue at gmx dot de
Description:
------------
On PHP 6 VC 6 from 3.sept.2009 the shell_exec command is broken.

Tested on Xampp on Windows XP with Apache 2.2.9.

Whatever you put into shell_exec e.g.
shell_exec("dir C:\\") 
produces a

Warning shell_exec() [function.shell-exec]: Unable to execute 'dir c:\'

The same script works fine on PHP 5


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-22 05:18 UTC] ian at iglou dot com
Also broken in PHP Version 5.2.10; safe mode off.

An earlier version (no record of which) did work when used thus to get a Windows dvd volume label:

if (preg_match('#Volume in drive [a-zA-Z]* is (.*)\n#i', shell_exec('dir '.$drive.':'), $m)) {
    $volname = ' ('.$m[1].')';
 [2009-09-22 08:41 UTC] pajoye@php.net
I can't reproduce it with php6 neither with 5.3 or 5.2 in CLI or FCGI.

Can you try it with CLI/CGI too please?
 [2009-09-22 13:46 UTC] elmue at gmx dot de
Hello 

On which PHP6 version did you test it ?
Did you test on Windows ?

I used version build Sep 3 2009 21:23:55
 [2009-09-22 14:06 UTC] pajoye@php.net
Windows, today snaps.
 [2009-09-22 14:06 UTC] pajoye@php.net
Try with a recent snap please
 [2009-09-22 20:54 UTC] elmue at gmx dot de
Yes you are right.
In the build from 22.sep.2009 this bug is fixed.
 [2009-09-22 20:57 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 15:01:32 2024 UTC