Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45187 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32447 invoked from network); 3 Aug 2009 08:01:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2009 08:01:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 204.13.248.72 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 204.13.248.72 mho-02-ewr.mailhop.org Received: from [204.13.248.72] ([204.13.248.72:59273] helo=mho-02-ewr.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/D4-05043-B49967A4 for ; Mon, 03 Aug 2009 04:01:16 -0400 Received: from a88-112-30-186.elisa-laajakaista.fi ([88.112.30.186] helo=localhost.localdomain) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.68) (envelope-from ) id 1MXsTn-000AFf-Ci; Mon, 03 Aug 2009 08:01:12 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 88.112.30.186 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX188kdOPSCowGbfkqBgt5lrWrv/Z+VHtmDs= Message-ID: <4A76993F.5000401@sci.fi> Date: Mon, 03 Aug 2009 11:01:03 +0300 Reply-To: jani.taskinen@iki.fi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: daniel@zoltak.com CC: 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> <20090803145207.l09o05kib4ow8448@webmail.zoltak.com> In-Reply-To: <20090803145207.l09o05kib4ow8448@webmail.zoltak.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] fopen_wrappers.c DOCUMENT_ROOT .htaccess error From: jani.taskinen@sci.fi (Jani Taskinen) On 08/03/2009 07:52 AM, daniel@zoltak.com wrote: >>> 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 > following result: Obviously you haven't compiled using --enable-debug OR most likely are not using the compiled libphp5.so. Check your phpinfo() that you actually use the one you compiled first.. --Jani > #0 0x00007f3e96df82eb in ?? () from /usr/lib64/apache2/modules/libphp5.so > #1 0x00007f3e96dfb085 in zend_hash_find () from > /usr/lib64/apache2/modules/libphp5.so > #2 0x00007f3e96d9229c in custom_open_base_check () from > /usr/lib64/apache2/modules/libphp5.so > #3 0x00007f3e96d90c56 in php_check_specific_open_basedir () from > /usr/lib64/apache2/modules/libphp5.so > #4 0x00007f3e96d9107f in php_check_open_basedir_ex () from > /usr/lib64/apache2/modules/libphp5.so > #5 0x00007f3e96d90fd4 in php_check_open_basedir () from > /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 > /usr/lib64/apache2/modules/libphp5.so > #8 0x00007f3e96e0511c in zend_alter_ini_entry () from > /usr/lib64/apache2/modules/libphp5.so > #9 0x00007f3e96e77ded in apply_config () from > /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 = 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, > "DOCUMENT_ROOT", > sizeof("DOCUMENT_ROOT"), (void **) &document_root) == FAILURE) { > > // Unable to find DOCUMENT_ROOT > php_error_docref(NULL TSRMLS_CC, E_WARNING, "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 zend_hash_find. > This only occurs when the following is defined in an 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 > code? If not is there an alternative or is there something wrong > somewhere else in the code? > > If you could guide me on how to produce the necessary output to debug it > would be much appreciated. > > Thanks >