|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15647 exec() only executes internal commands
Submitted: 2002-02-20 13:14 UTC Modified: 2002-04-30 06:33 UTC
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: eyal at zvi dot org Assigned:
Status: Not a bug Package: Program Execution
PHP Version: 4.1.1 OS: Windows 2000 Server
Private report: No CVE-ID: None
 [2002-02-20 13:14 UTC] eyal at zvi dot org
Using any of the external program execution methods (exec(), passthru(), etc.) only work with commands that are internal to the command interpreter.

For example passthru("dir") or passthru("time /t") work fine, however passthru("ping.exe localhost") or any other executable file - fails.

There is no error displayed, the script just continues execution without any noticeable delay.

One funny thing is that if a bogus command is passed, eg. passthru("blah_blah.exe"), a line is added to the Apache error log saying:

'blah_blah.exe' is not recognized as an internal or external command, operable program or batch file.

My setup is:

Windows 2000 Server, Apache 1.3.17, PHP 4.11 downloaded as binaries, configurations pretty straightforward (safe_mode=Off!).

I'll be glad to provide any further information.

Eyal Zvi.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-30 04:31 UTC] watford at uiuc dot edu
I have the exact same problem.  PHP.EXE does NOT have this problem but SYSTEM() and EXEC() do when run from Apache.  I too have submitted a bug report.
 [2002-04-30 06:33 UTC]
Check the permissions. #16924 is the same issue.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 04:01:23 2020 UTC