[phpxmlrpc] How to start/stop XML-RPC server?

David Luu mangaroo at gmail.com
Tue Dec 25 13:38:41 EST 2012


Thanks for the response Ken. Sorry, guess I wasn't too clear about my
question, part of my question is also about the lifecycle of the XML-RPC
server. Your response was rather generic in terms of PHP and not XML-RPC
"server" via PHP.

With other languages where the HTTP server is bundled/built into the
XML-RPC server, the lifecycle is you start up server, that's the instance
of the server and it ends when you shut down the server. During its
lifecycle/operation, all requests to the server go through the same XML-RPC
server instance.

>From your response and a re-looking at the code, I'm using these as
reference

http://phpxmlrpc.sourceforge.net/server.php?showSource=TRUE
PHP XML-RPC server doc: http://phpxmlrpc.sourceforge.net/doc-2/ch07s05.html

It appears the lifecycle is the "XML-RPC server" is initialized on an HTTP
request to any PHP page that invokes the "XML-RPC server" (whether directly
in the page code or via code in include file), and that the server sorta
stops after it completes the HTTP response back to the requesting client?
Because otherwise, the PHP module on the HTTP server would keep spawning
XML-RPC server instances if its lifecycle didn't end with the response
being sent back (memory leak, etc.), unless of course the PHP module knew
to reuse the server on subsequent requests.

David

On Tue, Dec 25, 2012 at 3:35 AM, Ken Almond <ken at almondenterprises.com>wrote:

> Hi
>
>
>
> Apache (when configured) loads a php.so module – so PHP is ‘loaded’ (ready
> to go) as part of apache startup.
>
> Yes, when HTTP hits Apache, the server.php file is loaded (on each HTTP
> request).     Since php.so module is already running as part of apache
> startup – its ‘very fast’ BUT you do want to keep server.php files smaller
> (1,000(s) of lines) instead of 50,000(s) of lines.     We used a URL name
> space to have multiple server.php files – e.g.    http://host/login.php
> (login.php is a server.php file),   http://host/accounts.php,   etc. -
> e.g. 1 ‘server.php’ for grouping of web services.   The login.php and
> account.php, and x.php and y.php can call into shared library.php(s) but
> again, overall, keep the #includes smaller so each server.php is not ‘too
> large’.     We achieved average 10ms (where php called MSSQL inside)
> response time for 1,000(s) of simultaneous users on single apache server.
>
>
>
> Bonus tip
>
> We put 1st apache server in DNZ zone (publically available for URL) and
> then used apache reverse proxy over to internal apache that that actually
> called the server.php(s) for very strong protection.    Worked very
> well.     Then as we grew, we used the reverse proxy to load balance – but
> apache also has other forms of load balance.
>
>
>
> Good Luck
>
> Ken
>
>
>
> *From:* phpxmlrpc-bounces at lists.usefulinc.com [mailto:
> phpxmlrpc-bounces at lists.usefulinc.com] *On Behalf Of *David Luu
> *Sent:* Monday, December 24, 2012 10:35 PM
> *To:* phpxmlrpc at lists.usefulinc.com
> *Subject:* [phpxmlrpc] How to start/stop XML-RPC server?
>
>
>
> I'm just looking into XML-RPC server with PHP, so have not much idea about
> its implementation and design.
>
>
>
> With other language implementations, it's easy to understand, as you can
> start/stop the server from command line (or other interface like UI,
> XML-RPC call for stop, etc.) as all the server functionality can be
> combined with the XML-RPC server itself as a single self contained
> binary/application.
>
>
>
> With PHP, the PHP code is served by a web/application server. So wanted
> some clarification:
>
>
>
> * how do you start the server? Start up the web/application server
> (Apache, IIS, etc.), then hit the URL to the PHP script that creates the
> server instance? Are the XML-RPC requests (different XML-RPC method calls)
> going to same URL or different one?
>
>
>
> * how do you stop the PHP XML-RPC server? Stop the web/application server
> itself? (e.g. Apache, IIS, etc.) Or is there a way to stop it w/o turning
> off the whole web/application server or say killing PHP.
>
>
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20121225/d8fb8324/attachment.html>


More information about the phpxmlrpc mailing list