ID:               22662
 User updated by:  pjaleysen at hotmail dot com
 Reported By:      pjaleysen at hotmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Program Execution
 Operating System: Windows XP
 PHP Version:      4.3.0
 New Comment:

HI, I tried it out with PHP Version 4.3.2-RC but the problem remains;
native MS-DOS commands work fine, other DOS-applications do not
respond.

kind regards
Patrick


Previous Comments:
------------------------------------------------------------------------

[2003-03-12 17:05:51] [EMAIL PROTECTED]

Yes, but the snapshot is 4.3.2-dev so try it out.
We're about to release 4.3.2 soon.



------------------------------------------------------------------------

[2003-03-12 17:04:09] pjaleysen at hotmail dot com

I have the same problem with php4.3 (at home)

------------------------------------------------------------------------

[2003-03-12 17:01:50] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

4.2.3 is way too old.


------------------------------------------------------------------------

[2003-03-12 11:58:58] pjaleysen at hotmail dot com

like I said, the native  Windows commands work correctly. I tried
putting cmd before a command, but invain.

This is a brief summary of the forum thread, found at
http://forums.devshed.com/t55038/s.html):

//---------------------------------------------------
I am trying to use pkzip to compress documents.
I am running a windows PC, so I am trying to execute a DOS command.

I have so far:
<?php
$pkzip="C:/Progra~1/Apache~1/Apache/readwr~1/pkzip.exe";
$pkzipdirectory="C:/Progra~1/Apache~1/Apache/readwr~1/";
$command=$pkzip." ".$pkzipdirectory."myzip.zip"."
".$pkzipdirectory."mydoc.doc";


shell_exec($command);
?>
It doesnt work
//---------------------------------------------------------
shouldn't have to as long as cmd.exe is in your path.
can't believe its not really.

maybe try a little test like this and see what you get back,
then you'll know if its a path problem.....

<?php

$test = shell_exec("ping 192.168.0.1");
echo $test;

?>
//------------------------------------------------------
The ping works ok!
I can do the standard commands alright.
I tried:
1)using absolute directories (like above)
2) changing path=, to include the pkzip file (A dos version of pkzip)
3) changing to the 'long' directory notation (e.g progra~1 => program
files)
//-------------------------------------------------
Executing commands in the shell from a PHP script only works 
when the program you are trying to execute resides in your 
system directory (windows 2000: c:\winnt\system32).
//-----------------------------------------
I might have a clue!?!?
e.g. I have a batchfile saying:

"echo this batchfile works"

running this with:
<?php
$test=shell_exec("run.bat ");
echo $test;
?>
echoos 'echo this batchfile works'

Shouldnt the 'echo' NOT be there in the echo $test? 
It's like it is just reading the line, instead of executing it.......
//------------------------

------------------------------------------------------------------------

[2003-03-12 11:47:40] [EMAIL PROTECTED]

Sorry, that should be shell_exec('cmd ver');

~ Andrew Heebner

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22662

-- 
Edit this bug report at http://bugs.php.net/?id=22662&edit=1

Reply via email to