Running Dos Program Via PHP

Hi

I have an issue with running a Dos program via Php and wonder if anyone can help ?

Basically I have written a Dos program that connects to a website via a MSHTML.HTMLDocument submits
a string and then get’s the result, if I run the app in a dos command window it works fine.

The problem comes when I try to run the program via php, I have tried

shell_exec
exec
and WSH Run & Exec

but they all do the same thing, it starts the program and then runs the first few lines of code then stops, I’m not getting any error’s in the Apache or Php logs !

I was wondering if it was a permissions issue ? or as the dos program is using a MSHTML.HTMLDocument it has something to do with that ?

The thing that is confusing me is that it work’s fine from a dos command window, and I thought the when using shell_exec ect that php would just open a command window and run the program.

I know this is a little light on details, I was not sure how much to include so if you need any further info please post what you need and I’ll update right away.

thanks in advance for any help.

Regards

Potman100

What have you tried? You can pipe the output into the results to see what happens. ( 2>&1)

Check some of the samples http://php.net/manual/en/function.shell-exec.php

Sponsor our Newsletter | Privacy Policy | Terms of Service