[PHP-DEV] Re: PHP 4.0 Bug #7880 Updated: PHP_URL_FOPEN doesn't work From: Alan Halachmi (alan <email protected>)
Date: 12/04/00

php-de>a. Remake and make sure that gcc is being called with -g. b. do a gdb httpd
php-de>c. run -X
php-de>d. hit ctrl-c (it might take a while to catch)
php-de>e. break php_fopen_wrapper
php-de>f. cont
php-de>g. open your test-script while its waiting
php-de>h. it should break when it trys to make the file request
php-de>i. hit n to step to the next line of code
php-de>j. see if it ever hits if(!(options & IGNORE_URL)){
php-de>k. if url wrappers is not compiled you would get
php-de> if (options & USE_PATH........ instead
php-de>and just replace the '$fp=file($url)' line with '$fp=fopen($url,"r")'

02:12am skeptic:root /#gdb /usr/local/bin/httpd
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...
(gdb) run -X
Starting program: /usr/local/bin/httpd -X
^C^C
Program received signal SIGINT, Interrupt.
0xff196928 in _so_accept () from /usr/lib/libc.so.1
(gdb) Quit
(gdb) break php_fopen_wrapper
Breakpoint 1 at 0xfee2a874: file fopen-wrappers.c, line 257.
(gdb) cont
Continuing.

Breakpoint 1, php_fopen_wrapper (path=0x161118 "/export/www/include/current/prod/config.php", mode=0xfef5bb70 "rb", options=1, issock=0xffbee414,
    socketd=0x15f1, opened_path=0xffbef6a0) at fopen-wrappers.c:257
257 if (opened_path) {
(gdb) n
258 *opened_path = NULL;
(gdb) n
264 if (!(options & IGNORE_URL)) {
(gdb) n
265 return php_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path);
(gdb) n
0xfee2a938 275 return php_fopen_and_set_opened_path(path, mode, opened_path);
(gdb) n
php_fopen_wrapper_for_zend (filename=0x1bc270 "", opened_path=0xfef5bb70) at main.c:494
494 php_sock_set_def_chunk_size(old_chunk_size);
(gdb) n
496 if (issock) {
(gdb) n
499 return retval;
(gdb) n
open_file_for_scanning (file_handle=0xffbef698) at zend-scanner.c:2832
2832 break;
(gdb) n
2842 if (!file_handle->handle.fp) {
(gdb) n
2845 if (!file_path) {
(gdb) n
2849 if (file_handle->handle.fp != stdin) {
(gdb) n
2848 file_handle->type = ZEND_HANDLE_FP;
(gdb) n
2849 if (file_handle->handle.fp != stdin) {
(gdb) n
2848 file_handle->type = ZEND_HANDLE_FP;
(gdb) n
2849 if (file_handle->handle.fp != stdin) {
(gdb) n
2850 zend_llist_add_element(&CG(open_files), file_handle);
(gdb) n
2853 yyin = file_handle->handle.fp;
(gdb) n
2854 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
(gdb) n
2853 yyin = file_handle->handle.fp;
(gdb) n
2855 BEGIN(INITIAL);
(gdb) n
2854 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
(gdb) n
2855 BEGIN(INITIAL);
(gdb) n
2900 zend_set_compiled_filename(file_path);
(gdb) n
2901 CG(zend_lineno) = 1;
(gdb) n
2902 return SUCCESS;
(gdb) n
compile_file (file_handle=0xffbef698, type=2) at zend-scanner.c:2937
2937 init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>