Page 1 of 1

Simple system call in PHP dosn't work on Windows Box???

Posted: Mon Feb 06, 2006 2:33 pm
by bradsteele
I have the following simple code and it dosn't work on a WIN2003 server, but it does work on a linux box??? Any ideas???
I am just trying to list the contents of the current directory, where the script resides?? Can't seem to figure out why it won't execute my shell command?

Code: Select all

<html>
<head>
<title>Untitled</title>
</head>
<body>

<?php
echo '<pre>';
$last_line = system("dir *.*", $retval);
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
?> 
</body></html>
Any help anyone can give me would be greatly appreciated.

Thanks,

Brad

Re: Simple system call in PHP dosn't work on Windows Box???

Posted: Mon Feb 06, 2006 2:44 pm
by Roja
bradsteele wrote:I have the following simple code and it dosn't work on a WIN2003 server, but it does work on a linux box??? Any ideas???
Click the linked "System" function from your code: http://us2.php.net/system

Read the user comments about permissions on IIS and Windows. System and Windows is *extremely* difficult to get working correctly.