Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77148 invoked from network); 28 May 2009 10:30:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2009 10:30:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.220.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 209.85.220.220 mail-fx0-f220.google.com Received: from [209.85.220.220] ([209.85.220.220:55113] helo=mail-fx0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/DF-30334-3D76E1A4 for ; Thu, 28 May 2009 06:30:44 -0400 Received: by fxm20 with SMTP id 20so6257456fxm.23 for ; Thu, 28 May 2009 03:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=zGSloE675wd+fdz1GFOrqPs0N+2Pf/UVboxGDDAq6lQ=; b=r7hH3w+8/maZj+L6xWczkHzN/vhxO03i1RPerhdzdXJVwqMXUZcapsk7BcBmKFiR5C qJqCMsDCciu9xCI+FbImB9LZCnyk4N9s0Sc72lINoCeDK/gKc1usY0/0aJrBTiZlCKRM DqeWbfHIHI1prxU6EwXEuF4S0CubMM9M2JdpQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=dXI31of2FWFXzsPkjPNbZSU1YzsZASPwfQeN89cpnagfmPiPCXTQG7PhdjT5UMwvjh DSe3Hcfhgi3biDV+aCNIjuFFIAbAeptXgc27pV9GSCrWYDKQsrZM5aEFLGuxNSV+3iMv ojB98a+/dmF2q42UlaGn1CwF8pBO2zML3YuS4= MIME-Version: 1.0 Received: by 10.223.126.10 with SMTP id a10mr1055013fas.17.1243506639114; Thu, 28 May 2009 03:30:39 -0700 (PDT) Reply-To: RQuadling@googlemail.com In-Reply-To: <6B.C0.13990.237891A4@pb1.pair.com> References: <6B.C0.13990.237891A4@pb1.pair.com> Date: Thu, 28 May 2009 11:30:19 +0100 Message-ID: <10845a340905280330k72ee009ajc4291935a79c7f00@mail.gmail.com> To: jvlad Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] shell_exec, environment, and multithreading servers From: rquadling@googlemail.com (Richard Quadling) 2009/5/24 jvlad : > Hi all, > > Recently I faced with one funny problem in PHP. Seems there is no way to = run > a sub-process using shell_exec() (or backticks), and pass there specially > crafted environment without affecting all running threads. As soon as I > update the environment, all other threads see the change. It's > multithreading nature to be running under the same process and share the > process environment, no problems so far, but there should be a way to run > sub-process with appropriate set of environment variables without affecti= ng > all the threads. > > Looks like for Win32 target, there is a popenex() function that is called= by > shell_exec and this function has env parameter. I think it makes sense to > pass $_ENV in this argument. Certainly, $_ENV should be converted into ar= ray > of pointers. > Not sure if there is any way under unix other =C2=A0than using execXX() i= nstead > of popen() to get the same behaviour. > > Thoughts? > > -jv > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Does resource proc_open ( string $cmd , array $descriptorspec , array &$pipes [, string $cwd [, array $env [, array $other_options ]]] ) for the bill here? --=20 ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=3DZEND002498&r=3D213474= 731 "Standing on the shoulders of some very clever giants!"