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:

#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


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to