Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22429 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10189 invoked by uid 1010); 14 Mar 2006 21:10:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10174 invoked from network); 14 Mar 2006 21:10:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2006 21:10:45 -0000 X-Host-Fingerprint: 66.80.117.3 longsword.omniti.com Linux 2.5 (sometimes 2.4) (4) Received: from ([66.80.117.3:60487] helo=mail.omniti.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id DE/68-55982-35137144 for ; Tue, 14 Mar 2006 16:10:43 -0500 Authentication-Results: mail.omniti.com smtp.user=george; auth=pass (LOGIN) DomainKey-Status: good X-DomainKeys: Ecelerity dk_sign implementing draft-delany-domainkeys-base-01 DomainKey-Signature: q=dns; a=rsa-sha1; c=nofws; s=test; d=omniti.com; h=Received:Message-ID:Date:From:User-Agent:X-Accept-Language:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=jIzQSKiv1RMXAxBx4GCUzwE2T4WTZdLyRXqou/czX2/TijqeLLW+CeposR6N2xoI DvdfJkuUGjRahQ/3fgBeSqvsPWZ1IBz6Zyn++S4WUbtdtt1F6dbgte85ZM1bAJFC Received: from ([66.80.117.2:3773] helo=[10.80.116.157]) by mail.omniti.com (ecelerity HEAD r(8116/8119M)) with ESMTPSA (cipher=AES256-SHA) id 9D/71-12178-94137144 for ; Tue, 14 Mar 2006 16:10:39 -0500 Message-ID: <44173149.2010000@omniti.com> Date: Tue, 14 Mar 2006 16:10:33 -0500 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Johannes Schlueter CC: internals@lists.php.net, Marco References: <2fd662a00603141148n1f3c6aw@mail.gmail.com> <200603142158.25640.johannes@php.net> In-Reply-To: <200603142158.25640.johannes@php.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP Embedded From: george@omniti.com (George Schlossnagle) Johannes Schlueter wrote: >Hi Mark, > >On Tuesday 14 March 2006 20:48, Marco wrote: > > >>Is there a way from within the embedded system to destroy all created >>variables so that the environment is the same as when it was started or do >>we need to shutdown the embedded engine and start it up again? >> >> > >PHP was designed as an language running as an module inside an webserver to >run multiple, independent, request, one after each other. So PHP supports >reinitilizing the engine without restarting everything. Look around for >php_request_startup() and php_request_shutdown() and how they are used. > > > >>Also a problem they are coming up with occasionally is that the php engine >>will crash when >> >>php_embed_init(argc, argv PTSRMLS_CC); >> >>is called, they havent found any reproducible steps yet. Could this be >>caused by shutting down and starting up the emdedded engine from within the >>same app? I have asked and the application isnt multi threaded. >> >> > >Here one can't say much without any details (_relevant_ code and backtrace) > >php_embed_* are afaik wrapping up the complete engine und request init and >shutdown. If you want to do multiple independent requests you should take an >a bit closer look on the SAPI layer to use the functions I mentioned above. > > If you want an example of doing request startup/shutdown multithreaded with the embed SAPI and are willing to wade through a bit of XS, you can check out the PHP::Interpreter Perl module (on CPAN: http://search.cpan.org/dist/PHP-Interpreter/). That links against the embed SAPI but uses the native engine calls for handling request mortality. You could also check out Sara's runkit in PECL, I think that does similar stuff. George