Re: [PHP] Launch a seperate process

This is a discussion on Re: [PHP] Launch a seperate process within the PHP General forums, part of the PHP Programming Forums category; On Tue, March 6, 2007 4:06 pm, Brad Fuller wrote: > Is there a way in a php script ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2007
Richard Lynch
 
Posts: n/a
Default Re: [PHP] Launch a seperate process

On Tue, March 6, 2007 4:06 pm, Brad Fuller wrote:
> Is there a way in a php script to launch another script but output
> something
> and exit (terminating the original request) before that script
> finishes?
>
> I have a script that accepts data, does some stuff, returns a response
> and
> exits.
>
> I want that page to accept data, return a response and exit. Then the
> stuff
> happens.
>
> Make sense?
>
> I am STFW right now, but nothing yet.
>
> Any advice is much appreciated.


http://php.net/pcntl

What you describe is called "fork" for a more general Google
experience about it.

To take a previous post a bit further:
Unless you are 100% sure that all your OTHER extensions are
thread-safe, you should not add pcntl to your web-server installation,
unless you actually LIKE random server crashes as your forked threads
stomp all over each other...

And, from hard-won recent personal experience, in Gentoo, you have to
edit /etc/make.conf or whatever it is and NOT the /etc/packages
thingie, and definitely not just USE in the ports system, because
otherwise you will find yourself a victim of Gentoo assuming one of
the following:


Oh, you said you wanted pcntl, but this is an Apache build, and that's
bad, so I'll take it out.

Oh, you said you wanted PHP CLI with pctnl, but you had Apache module
before, so I'll uninstall Apache module to give you PHP CLI.

Oh, you said you wanted Apache Module without pcntl, but you had PHP
CLI before, so I'll uninstall PHP CLI to give you Apache module.


I'm not quite sure why Gentoo package making people thought all that
was a "good idea", but it did at least give me LOTS of practice in
installing PHP under Gentoo...

Tossing pcntl and Apache into the /etc/make.conf, for some reason
beyond my ken, convinced Gentoo that I actually wanted pcntl in CLI
where it makes sense, and not in Apache module where it doesn't.

This was PHP 4 and Apache 1.3, in case that matters.

YMMV
NAIAA

PS I do not claim to actually understand the Gentoo adminstration of
software installation system. In fact, I can categorically state that
I just do NOT "get" this system... Oh well. It's just my laptop, and
the REAL systems are managed by the expert.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0