[snip] Has anyone been able to get PHP working fully under IIS 6.0? If so, try
the following script:
<?PHP print_r(shell_exec('dir')); ?>
I get "Warning: shell_exec() [function.shell-exec]: Unable to execute" whenever I try this or any other shell_exec or back tick (`) shell
function.
I've tried running in IIS 5.0 isolation mode, and setting all kinds of execution permissions to no avail.
[/snip]
6.0 or 5.0 (you mention both)?
AFAIK print_r(shell_exec('dir')); will not work for several reasons...
shell_exec(`dir`) would not return an array, so print_r for that would be unable to execute. Have you tried opendir() and readdir()? That is the way to get a directory listing.
Try this;
$var = shell_exec(`dir`); echo $var;
print_r worked when I ran php from the command line. print_r when it's not an array acts just like print.
IIS 6.0 is the target platform. It has a feature where you can run in "IIS 5.0 Isolation Mode", supposedly to make applications that can't run properly under the new security model of IIS 6.0. This doesn't work for php. And the error I get is that shell_exec couldn't execute.
My application is not actually running `dir`, I'm running an ImageMagick identify/convert operation, but that's the simplest script that reproduces the problem. Maybe the ImageMagick pecl library is my only hope.
Joseph
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php