Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45184 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9518 invoked from network); 3 Aug 2009 04:52:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2009 04:52:19 -0000 Authentication-Results: pb1.pair.com header.from=daniel@zoltak.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=daniel@zoltak.com; spf=permerror; sender-id=softfail Received-SPF: error (pb1.pair.com: domain zoltak.com from 203.16.214.57 cause and error) X-PHP-List-Original-Sender: daniel@zoltak.com X-Host-Fingerprint: 203.16.214.57 ipmail04.adl2.internode.on.net Received: from [203.16.214.57] ([203.16.214.57:14781] helo=ipmail04.adl2.internode.on.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/B0-05043-DFC667A4 for ; Mon, 03 Aug 2009 00:52:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au8DAP4HdkqWZZo2/2dsb2JhbACBUpdUtySEGAWBSg X-IronPort-AV: E=Sophos;i="4.43,312,1246804200"; d="scan'208";a="426740223" Received: from ppp154-54.static.internode.on.net (HELO zoltak.com) ([150.101.154.54]) by ipmail04.adl2.internode.on.net with SMTP; 03 Aug 2009 14:22:07 +0930 Received: (qmail 28286 invoked from network); 3 Aug 2009 04:52:07 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by 127.0.0.1 with SMTP; 3 Aug 2009 04:52:07 -0000 Received: from myob.com.au (myob.com.au [203.34.100.2]) by webmail.zoltak.com (Horde MIME library) with HTTP; Mon, 03 Aug 2009 14:52:07 +1000 Message-ID: <20090803145207.l09o05kib4ow8448@webmail.zoltak.com> Date: Mon, 03 Aug 2009 14:52:07 +1000 To: jani.taskinen@iki.fi, Jani Taskinen Cc: Rasmus Lerdorf , internals@lists.php.net References: <20090731101017.jcs6fiyk0sg4gcok@webmail.zoltak.com> <4A72A254.8030808@sci.fi> <4A7545C4.60202@zoltak.com> <4A75A950.6030701@sci.fi> <4A760126.9070002@lerdorf.com> <4A76199F.9040701@sci.fi> In-Reply-To: <4A76199F.9040701@sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.6) Subject: Re: [PHP-DEV] fopen_wrappers.c DOCUMENT_ROOT .htaccess error From: daniel@zoltak.com >> Jani Taskinen wrote: [snip] >>> You obviously do not have the correct sources then. >>> Try get them directly using SVN: >>> >>> # svn co http://svn.php.net/repository/php/php-src/branches/PHP_5_2/ >>> >>> And if those don't work either, you need to provide a GDB backtrace, the >>> strace is useless for this. Also make sure you configure PHP using >>> --enable-debug !! I have compile both apache and php using debug and run gdb with the =20 following result: #0 0x00007f3e96df82eb in ?? () from /usr/lib64/apache2/modules/libphp5.so #1 0x00007f3e96dfb085 in zend_hash_find () from =20 /usr/lib64/apache2/modules/libphp5.so #2 0x00007f3e96d9229c in custom_open_base_check () from =20 /usr/lib64/apache2/modules/libphp5.so #3 0x00007f3e96d90c56 in php_check_specific_open_basedir () from =20 /usr/lib64/apache2/modules/libphp5.so #4 0x00007f3e96d9107f in php_check_open_basedir_ex () from =20 /usr/lib64/apache2/modules/libphp5.so #5 0x00007f3e96d90fd4 in php_check_open_basedir () from =20 /usr/lib64/apache2/modules/libphp5.so #6 0x00007f3e96d86adb in ?? () from /usr/lib64/apache2/modules/libphp5.so #7 0x00007f3e96e05346 in zend_alter_ini_entry_ex () from =20 /usr/lib64/apache2/modules/libphp5.so #8 0x00007f3e96e0511c in zend_alter_ini_entry () from =20 /usr/lib64/apache2/modules/libphp5.so #9 0x00007f3e96e77ded in apply_config () from =20 /usr/lib64/apache2/modules/libphp5.so #10 0x00007f3e96e77033 in ?? () from /usr/lib64/apache2/modules/libphp5.so #11 0x0000000000436633 in ap_run_handler () #12 0x0000000000439511 in ap_invoke_handler () #13 0x00000000004430b4 in ap_process_request () #14 0x0000000000440706 in ?? () #15 0x000000000043ceb4 in ap_run_process_connection () #16 0x0000000000446db7 in ?? () #17 0x0000000000447012 in ?? () #18 0x00000000004470ac in ?? () #19 0x0000000000447cc8 in ap_mpm_run () #20 0x0000000000425ab3 in main () The function custom_open_base_check() contains: // Document root from Zend (pointer to pointer) zval **document_root =3D NULL; // Make sure DOCUMENT_ROOT is accessible from the global vars if (!PG(http_globals)[TRACK_VARS_SERVER] || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, =20 "DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT"), (void **) &document_root) =3D=3D FAILURE) { // Unable to find DOCUMENT_ROOT php_error_docref(NULL TSRMLS_CC, E_WARNING, =20 "fopen_wrapper_patch: DOCUMENT_ROOT variable is not set, cannot determine document root."); // Can't check the document root - fail return -1; } It crashing when its looking up the DOCUMENT_ROOT in the =20 zend_hash_find. This only occurs when the following is defined in an =20 .htaccess and with the custom function in place: [snip] php_value error_log '/home/st/stu/studio1.com.au/www/logs/php_err.log' Is it safe to access the DOCUMENT_ROOT this way at this point in the =20 code? If not is there an alternative or is there something wrong =20 somewhere else in the code? If you could guide me on how to produce the necessary output to debug =20 it would be much appreciated. Thanks