Page 1 of 1

using PHP to run third party program (IIS)

Posted: Sun Feb 17, 2008 10:59 pm
by FATO
Hi all, I'm new to PHP and to this forum too.

I got a problem regarding to the subject title by using exec() / system() and other forms of program execution listed on the official PHP website. I hope that anyone who got similar experience or solution can reply to this topic.

The target application is a .BAT file. For example, The .BAT file is used to open notepad.exe. It works when I double click the notepad.BAT. However, it wont work when I use exec(notepad.BAT); in my PHP code. The browser hanged without any response and when I open up the task manager the notepad.exe is somehow running in the background.

I've tried searching the forum about related topics and followed some of the instructions given(security settings) by fellow solution contributors. Unfortunately those wont work as well.

Thanks in advance to those who read and reply.

Re: using PHP to run third party program (IIS)

Posted: Sun Feb 17, 2008 11:06 pm
by Christopher
Functions like exec() are to run console applications that provide output on stdout. Notepad is a Windows app that will not work like this.

Re: using PHP to run third party program (IIS)

Posted: Sun Feb 17, 2008 11:10 pm
by FATO
Oh... Notepad is just an example, I've tried on other applications like Winamp, third party video format convertor software that supports batch file processing also. Same situation...

Re: using PHP to run third party program (IIS)

Posted: Fri Feb 29, 2008 1:26 am
by FATO
I've tried Apache and did the following:

go start->control panel->administrative tools->services

then set the Apache 2 to log on as my account. It works.

But when I try to do the same on IIS, the IIS service itself failed to restart. Any ideas?