Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19223 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10937 invoked by uid 1010); 28 Sep 2005 03:27:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10922 invoked from network); 28 Sep 2005 03:27:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Sep 2005 03:27:34 -0000 X-Host-Fingerprint: 64.4.204.18 unknown Linux 2.4/2.6 Received: from ([64.4.204.18:50619] helo=mail.toddesposito.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A8/D6-54476-6AD0A334 for ; Tue, 27 Sep 2005 23:27:34 -0400 Received: from mail.toddesposito.com (localhost [127.0.0.1]) by mail.toddesposito.com (Postfix) with ESMTP id E4B84A1DC1; Tue, 27 Sep 2005 22:27:30 -0500 (CDT) Received: from 67.184.68.1 (SquirrelMail authenticated user todd@toddesposito.com); by mail.toddesposito.com with HTTP; Tue, 27 Sep 2005 22:27:31 -0500 (CDT) Message-ID: <3918.67.184.68.1.1127878051.squirrel@67.184.68.1> In-Reply-To: <1886553938.20050927114226@kwikin.com> References: <35725.67.184.68.1.1127405661.squirrel@67.184.68.1> <1886553938.20050927114226@kwikin.com> Date: Tue, 27 Sep 2005 22:27:31 -0500 (CDT) To: internals@lists.php.net, "Tom Rogers" Reply-To: Todd@ToddEsposito.com User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] on-the-fly changes to php.ini values? From: Todd@ToddEsposito.com ("Todd D. Esposito") Tom, Thanks for the reply. As it happens, I went ahead and hacked around in the internal a bit more, and came up with a working solution bypassing zend_alter_ini_entry, instead getting the php per-server config block, and updating the configuration has via zend_hash_update calls. It works (though there is a case where corruption of the php config block can occur, so care is warranted), but leaves me still wondering if there is any "official" way to do this, or at least one recommended over another. In other words, is _alter_ini_ a better tactic than _hash_update? Any opinion? On Mon, September 26, 2005 20:42, Tom Rogers said: > Hi Todd, > > A small typo in one line corrected > > *************************************** > > I have done a similar thing for apache 1.3 and did the following: > > added headers > > #ifdef HAVE_MOD_PHP_SUPPORT > #include > #include > #include > #include > #include > #include > #endif > > and the following code > (doc_root is set to /usr/local/apache/domains/domain.com) > > // It all comes down to this lot > //all virt domains get an include directory above document root > var = ap_pstrcat(r->pool, doc_root, "/include", NULL); > //build a new include path adding in the default > include_path = > ap_pstrcat(r->pool,"./;",var,";",zend_ini_string("include_path",13,1),NULL); > //update zend > zend_alter_ini_entry("include_path", 13, include_path, > strlen(include_path), 4, 16); > > //set some env vars > ap_table_setn(r->subprocess_env, "PHPINCDIR", var); > ap_table_setn(r->subprocess_env, "DOMAIN_ROOT", doc_root); > //correct the documennt root (all html is in doc_root/www) > conf->ap_document_root = ap_pstrcat(r->pool, doc_root, "/www",NULL); > //add openbase dir to the one set in httpd.conf > obasedir_path = ap_pstrcat(r->pool, aliases->OpenBaseDir, ";", doc_root, > NULL); > //update zend > zend_alter_ini_entry("open_basedir", 13, obasedir_path, > strlen(obasedir_path), 4, 16); > > You will have to use different ap_xxx commands but it should work > -- > regards, > Tom > > Todd D. Esposito www.ToddEsposito.com Todd@ToddEsposito.com 630-362-6868