Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78443 invoked from network); 27 Jun 2014 09:19:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2014 09:19:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:58548] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/28-11209-3173DA35 for ; Fri, 27 Jun 2014 05:19:16 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 0BBC241355; Fri, 27 Jun 2014 11:19:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.31] (ppp-93-104-15-92.dynamic.mnet-online.de [93.104.15.92]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 4AA2F41354; Fri, 27 Jun 2014 11:19:15 +0200 (CEST) To: Ingwie Phoenix Cc: internals@lists.php.net In-Reply-To: <0DF815F8-5991-46EC-9BD4-53575F774BAC@googlemail.com> References: <1403777679.12695.14.camel@guybrush> <0DF815F8-5991-46EC-9BD4-53575F774BAC@googlemail.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 27 Jun 2014 11:18:36 +0200 Message-ID: <1403860716.12695.34.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Embedding PHP, few additional questions. From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Fri, 2014-06-27 at 07:57 +0200, Ingwie Phoenix wrote: > I also did some research, and learned that OPCaches are stored in > shared memory. Wouldn’t shared memory get lost when the interpreter is > shut down, or how is this working? Is shared memory actually „fully > associated“ to a program? Excuse me for the dumb question, It is just > my first direct confrontation with shared memory, ever. In general "shared memory" might mean many things. In this opcache case you can assume that when PHP is shutdown (not only the request) the shared memory is freed. > In your pconn SAPI, you are telling PHP that you are not going to use > headers… but, in my case, I have an incomming HTTP request and should > very much forward those headers. What is the function that I must look > at, to copy my headers? php-src/sapi/ has quite a few examples and php-src/main/SAPI.c and related files show implementation of details. If you're referring to the no_headers flag this is about setting headers from PHP which would otherwise be sent to the SAPI's header hooks ... > As this is going to be a nodejs module (v8php), I will link most of > these functions into JS scope by supplying wrappers and the like. > Going to be pretty interesting to see this in actual work, and > comparign the speed to just using child_process.spawn. It will be worse - without really looking into child_process.spawn I assume that is non-blocking. I assume you're PHP implementation will be blocking and therefore hold all other things in nodejs. For making it non-blocking you'd have to play a bit with threads and send PHP of to worker threads and ensure it's compiled in TSRM mode which costs extra time while executing. The better approach would be to use FastCGI / FPM as communication with PHP. While I'd question the architecture of such an system ... johannes