Jump to content

Calls to exec, pass_thru et al do nothing (it seems)


DominicWatson

Recommended Posts

Hi all,

 

I'm running PHP on Windows server 2003 with IIS 6.0 and I am getting nothing out of exec(), pass_thru(), et al. Ie. If I run the following script, I get the output 'Hello world':

 

<?php
    echo 'Hello';
    echo `ipconfig`;
    echo ' world';
?>

 

If I type ipconfig in the command prompt, I get the expected output. Using the above code on my Vista laptop also produces the expected output (running PHP on Apache).

 

I have checked the php.ini file for possible causes but I am an uber php noob so I don't really know what I am looking for beyond SAFE_MODE = OFF (which it is).

 

Any direction would be greatly appreciated. Thanks for your time,

 

Dominic

isn't it

 

<?php echo exec('ipconfig'); ?>

 

The following all execute system commands but in slightly different ways:

 

<?php 
    echo exec('ipconfig', $outputArray);
    echo pass_thru('ipconfig');
    echo `ipconfig`;
?>

 

None of them work in the Windows 2003 setup though they all work on my Vista setup. I'm assuming its a security / user issue but I'm not really hot on those things.

 

Dominic

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.