php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19878 exec() function failed to execute win32 EXE programs
Submitted: 2002-10-12 00:22 UTC Modified: 2002-10-12 02:22 UTC
From: datung84 at hotmail dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.2.3 OS: Windows 2000 Adv. Server
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: datung84 at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-10-12 00:22 UTC] datung84 at hotmail dot com
I seem to have a problem running the exec() function. I created a php program that when user uploads a file it will automatically open an anti-virus program and check the specific file, but the execution didn't occur at all. Nothing happened. So I was wondering if exec will ever work if you run any win32 executable programs using exec(). Pease fix the bug please please. 

If you can give me a solution on how to resolve such problem, please let me know.

Thanks,
Jon

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-12 02:22 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.
 [2002-10-16 20:00 UTC] tekno at shadowfox dot homelinux dot org
I've had this same thing happen to me.  Using php4.0.6 running an system command works fine and will return output.  As soon as I upgraded to 4.2.3 the script no longer works.  I'm running win2k with PHP4.2.3 and have apache running as a local user with permission to exec and read the file.  

I have found that if there is more than one set of double quotes in the command it will no longer work.  Also putting the command into a .bat file will allow it to be run correctly if I call the .bat file.

Example:
<?
	$cmd ="\"c:\\dialup\\rcl.exe\" -c -u \"dialup_username\" -p \"dialup_password\"";
	$output = `$cmd`;

	echo "Attempted: $cmd<br>";
	echo "Returned: <pre>$output</pre>";

	//Attempted: "c:\supersalon\ssproject\scripts\rcl.exe" -c -u "dialup_username" -p "dialup_password"
	//Returned:
?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 10 17:01:28 2024 UTC