Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute problems with PHP

Status
Not open for further replies.

DanglingPointer

Programmer
Apr 5, 2003
22
GB
Hi

I have built a small application which basically gets various kinds info for some PCs on our LAN using PHP to execute (shell_exec()) command line progs (psinfo, pulist) and formats the info in an html table.

The problem is that although everything works from the local machine, no output appears from the cmd line programs from any other machine on the LAN. The html and PHP pages are accessible ok.

Strangely calls to "ping" work, so I tried an explicit path to the programs, but still no luck.
 
I don't know much about programming and even less about PHP, but my immediate thought is what context are these scripts running under? If you're essentially running cmd.exe from your scripts, I can see why it only works on the local machine. Unless it's a network-type command, such as ping or NET, it won't work. You can't run cmd.exe on your own machine and expect it to run commands elsewhere.

If you want to do that, you will need to install a reskit utility called RCMD on each machine (Remote Command) and make sure the user account executing (the logged on user running your php script I imagine) has the correct permissions on the target machines.

The other thought I have, if that isn't the issue, is permissions in general. Does the user running the scripts have admin rights on the target machine?

Apologies if I'm completely barking up the wrong tree, but you might want to ask your question on a PHP forum (this problem doesn't seem to be IIS-related)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top