Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Launching a background script from php in Windows/IIS

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS HTTP 500 Error - Not Page Related  
Author Message
nospam89

External


Since: Sep 08, 2003
Posts: 1



(Msg. 1) Posted: Mon Sep 08, 2003 9:14 pm
Post subject: Launching a background script from php in Windows/IIS
Archived from groups: comp>lang>php, others (more info?)

Hi,

I'm trying to build a PHP page which launches another php script to be run
in the background. The web page should return immediately, while the
background script may run for 10 minutes or something. Unfortunately I'm
getting all kinds of weird behaviour..

In my main script I'm using exec() (also tried the other options) to start a
..bat file. This actually works, the batch file is launched and is able to
write something to disk.. Now if I put the following line in the batch file:

c:\php\php.exe -q backgroundscript.php

then instantly I'm seeing about 30 php.exe processes being created, but
nothing seems to be happening really. The processes seem to be dying
immediately and replaced by new ones. So apparently php is trying something
but fails and tries again.

Both the script and the batch file work fine from the command line. Group
'Everyone' has read/execute rights for the batch file, the php script and
php.exe. I have tried prefixing the command with START /b or cmd.exe /c but
neither seem to make any difference. Also I tried redirecting stderr, stdout
and stdin to NUL

Server is Win2k, IIS5, php4.3.0. Searched the php docs, tried suggestions
but it doesn't work, maybe because they use Apache.

My guess is that the anonymous user IUSR_* doesn't have the rights to do
something, but I can't figure out what. Please help me if you have an idea..

Bob

 >> Stay informed about: Launching a background script from php in Windows/IIS 
Back to top
Login to vote
user748

External


Since: Sep 08, 2003
Posts: 2



(Msg. 2) Posted: Mon Sep 08, 2003 9:14 pm
Post subject: Re: Launching a background script from php in Windows/IIS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bob" <nospam RemoveThis @nospam.com> wrote in message
news:<bji9ti$lcd$1@news.cistron.nl>...
 >
 > I'm trying to build a PHP page which launches another php script
 > to be run in the background.
....
 > Now if I put the following line in the batch file:
 >
 > c:\php\php.exe -q backgroundscript.php

....you would be launching the wrong interpreter. The command-line
interpreter on Windows is not c:\php\php.exe, but, rather,
c:\php\cli\php.exe

Cheers,
NC<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Launching a background script from php in Windows/IIS 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]