Re: Persistent PHP web application?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> So if what your application mostly does is load in all this data and
>> respond to requests, you could write a *SINGLE* PHP application which
>> listened on port 12345 (or whatever port you like) and responded with
>> the
>> data requested.  Like writing your own web-server, only it's a
>> _________-server where you get to fill in the blank with whatever your
>> application does.
>
> Please see my repsonse to Manuel Lemos and his suggestion to run a SOAP
> server. Basically my concern is the lack of having a
> multi-process/forking server to handle concurrent incoming requests
> (which may or may not be a problem - not sure).  We're talking about a
> persistent PHP server (SOAP or otherwise), and I'm having trouble
> groking how that would work in an environment with many concurrent
> requests.  (Other than, of course, running a PHP SOAP server inside
> Apache which brings me back to square one :)

[shrug]
In my Dream World, you could run as many "%> php -q wyw_server.php"
processes as you like, and the low-level socket code would take care of
only having one of them respond to any given request.

Assuming that's not Reality Based, I guess you could try to figure out how
Apache does its pre-fork and child management...

Ya know, Rasmus' answer of just making your own PHP Module is looking REAL
GOOD right now...

You'll have to stumble your way through a LITTLE bit of C -- most of which
is going to be copy&paste from his example code (http://talks.php.net)

And then you're going to copy&paste your monster array into your new C code.

Then you'll have to change every line with $foo to just have foo, and
declare foo correctly, and segregate all your data/arrays so all the
arrays have only one kind of data in them, and...

It's going to be confusing as hell at first, but do it with a very SMALL
version of your monster array, and after you get the hang of that, it will
be a lot of global Search&Replace to make your big array work.

Or you could pay a guy who knows C and PHP to do it in, what, a couple
hours?  Depends on how confusing your arrays are, and how heterogeneous
they are, I guess.

Once you do that, all your data is in PHP/Apache when it launches, and
it's always available to your PHP script all the time.  Sweet.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux