Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74795 invoked by uid 1010); 25 May 2006 11:16:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74780 invoked from network); 25 May 2006 11:16:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2006 11:16:40 -0000 X-PHP-List-Original-Sender: nabeel@wso2.com X-Host-Fingerprint: 209.68.5.9 relay00.pair.com Received: from ([209.68.5.9:2700] helo=relay00.pair.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id FC/B5-17316-81295744 for ; Thu, 25 May 2006 07:16:40 -0400 Received: (qmail 7487 invoked from network); 25 May 2006 11:16:35 -0000 Received: from unknown (HELO ?192.168.1.238?) (unknown) by unknown with SMTP; 25 May 2006 11:16:35 -0000 X-pair-Authenticated: 222.165.179.80 Message-ID: <44758B30.5090403@wso2.com> Date: Thu, 25 May 2006 16:47:12 +0600 User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net References: <44742E5E.3000905@wso2.com> <54342.67.108.68.36.1148507219.squirrel@www.l-i-e.com> In-Reply-To: <54342.67.108.68.36.1148507219.squirrel@www.l-i-e.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Unable to load DSO's when using embed sapi module From: nabeel@wso2.com (Nabeel) Thanks for the guess. But when one of these parameters is wrong, PHP engine specifically says so. My configuratin options for php build are --with-apxs2=/usr/local/apache2/bin/apxs --enable-embed=static --with-zlib --enable-debug. I use phpize with the extension. So, this automatically makes the version, debug info, zts settings info of the extension exactly similar to those of PHP. I have listed the gdb trace for successful and unsuccessful cases. I'd appreciate if someone can point what the root cause for this issue. =========================================================================== When I run a php file through CLI the gdb trace I get is listed below. It successfully loads the axis2.so Breakpoint 1, php_ini_register_extensions () at /usr/app/php-5.1.4/main/php_ini.c:552 552 zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC); (gdb) n 553 zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb TSRMLS_CC); (gdb) s zend_llist_apply (l=0x837ab9c, func=0x820e5d1 ) at /usr/app/php-5.1.4/Zend/zend_llist.c:190 190 for (element=l->head; element; element=element->next) { (gdb) n 191 func(element->data TSRMLS_CC); (gdb) s php_load_function_extension_cb (arg=0x97a7650) at /usr/app/php-5.1.4/main/php_ini.c:232 232 zval *extension = (zval *) arg; (gdb) n 235 php_dl(extension, MODULE_PERSISTENT, &zval, 0 TSRMLS_CC); (gdb) p *extension $4 = {value = {lval = 159003284, dval = 1.7054524387922518e-313, str = {val = 0x97a3294 "axis2.so", len = 8}, ht = 0x97a3294, obj = {handle = 159003284, handlers = 0x8}}, refcount = 0, type = 6 '\006', is_ref = 243 ' (gdb) n 236 } (gdb) n zend_llist_apply (l=0x837ab9c, func=0x820e5d1 ) at /usr/app/php-5.1.4/Zend/zend_llist.c:190 190 for (element=l->head; element; element=element->next) { (gdb) 193 } (gdb) php_ini_register_extensions () at /usr/app/php-5.1.4/main/php_ini.c:555 555 zend_llist_destroy(&extension_lists.engine); (gdb) ================================================================================= When I use the embed sapi, it fails without being able to load axis2.so (please see the gdb trace below) Breakpoint 1, php_ini_register_extensions () at /usr/app/php-5.1.4/main/php_ini.c:552 552 zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC); (gdb) n 553 zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb TSRMLS_CC); (gdb) s zend_llist_apply (l=0x8344f5c, func=0x80d6f2d ) at /usr/app/php-5.1.4/Zend/zend_llist.c:190 190 for (element=l->head; element; element=element->next) { (gdb) n 191 func(element->data TSRMLS_CC); (gdb) s php_load_function_extension_cb (arg=0x920e580) at /usr/app/php-5.1.4/main/php_ini.c:232 232 zval *extension = (zval *) arg; (gdb) n 235 php_dl(extension, MODULE_PERSISTENT, &zval, 0 TSRMLS_CC); (gdb) p *extension $3 = {value = {lval = 153133716, dval = 1.7051624436017789e-313, str = {val = 0x920a294 "axis2.so", len = 8}, ht = 0x920a294, obj = {handle = 153133716, handlers = 0x8}}, refcount = 0, type = 6 '\006', is_ref = 61 '='} (gdb) s php_dl (file=0x920e580, type=1, return_value=0xbf943d74, start_now=0) at /usr/app/php-5.1.4/ext/standard/dl.c:113 113 if (type == MODULE_PERSISTENT) { (gdb) n 114 extension_dir = INI_STR("extension_dir"); (gdb) 119 if (type == MODULE_TEMPORARY) { (gdb) 122 error_type = E_CORE_WARNING; (gdb) 125 if (extension_dir && extension_dir[0]){ (gdb) 126 int extension_dir_len = strlen(extension_dir); (gdb) 128 libpath = emalloc(extension_dir_len+Z_STRLEN_P(file)+2); (gdb) 130 if (IS_SLASH(extension_dir[extension_dir_len-1])) { (gdb) 133 sprintf(libpath, "%s%c%s", extension_dir, DEFAULT_SLASH, Z_STRVAL_P(file)); /* SAFE */ (gdb) 125 if (extension_dir && extension_dir[0]){ (gdb) p libpath $4 = 0x923bd04 "/usr/local/lib/php/ext/axis2.so" (gdb) n 140 handle = DL_LOAD(libpath); (gdb) s 141 if (!handle) { (gdb) n 142 php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR()); thanks, -Nabeel Richard Lynch wrote: >Wild Guess: > >You maybe have different versions and/or different debug/zts settings >on the binaries, and need to re-compile the other files in parallel... > >On Wed, May 24, 2006 4:58 am, Nabeel wrote: > > >>Hi, >> >> I want to call PHP code from C. So, I compiled sapi/embed module >>with my PHP 5.1.4 source (--enable-embed=static). It works fine when I >>access standard PHP functions. When any .so file (e.g.: axis2.so) is >>dynamically loaded to PHP, it gives the following error when I run my >>test C code. (this happens with other DSO's as well.) >> >>PHP Warning: PHP Startup: Unable to load dynamic library >>'/usr/local/lib/php/ext/axis2.so' - /usr/local/lib/php/ext/axis2.so: >>undefined symbol: _zval_ptr_dtor in Unknown on line 0 >> >>axis2.so works fine thourgh cli and apache interfaces. I wonder >>whether >>I am missing something. Any help is greatly appreciated. >> >>Thanks, >>-Nabeel >> >>-- >>PHP Internals - PHP Runtime Development Mailing List >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >> > > > >