php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11754 exec() function not working in Win32
Submitted: 2001-06-27 15:02 UTC Modified: 2001-07-27 10:46 UTC
From: stephen at pierzchala dot com Assigned:
Status: Closed Package: Program Execution
PHP Version: 4.0.6 OS: Win32 (2000)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: stephen at pierzchala dot com
New email:
PHP Version: OS:

 

 [2001-06-27 15:02 UTC] stephen at pierzchala dot com
- Standard Win32 PHP install
- Apache 1.3.20, Win32
- PHP running as a module
- Unix Tools running on Win32 platform

DEMO SCRIPT:

<?

if ($query != "" || $query != NULL) {
	$do_time = time();
	$test = $do_time.".txt";
	exec("egrep -i $query c:/Apache/logs/access.log > c:/Apache/htdocs/output/$test");
	@$data=fopen("c:/Apache/htdocs/output/$test", "r");
	if (!@$data=fopen("c:/Apache/htdocs/output/$test", "r")) {

		echo("<font class=\"larger\">There May Have Been An Error With Your Query As No Output File Was Generated.<br>");
		echo("Please Check The Syntax Of Your Query.</font>");
	} else {
		$file=fpassthru($data);
	}
} else {
	echo("<font class=\"larger\">There Was No Query To Analyze.<br>");
	echo("Please Re-Enter Your Query.</font>");
}

exec("c:/Apache/htdocs/del.bat c:\Apache\htdocs\output\$test");

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-27 22:04 UTC] sniper@php.net
So which exec() in your script doesn't work?
Please make it short as possible.

 [2001-07-27 10:46 UTC] kalowsky@php.net
no user feedback.  if the bug still exists, please reopen it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 13:01:27 2024 UTC