Re: [PECL-DEV] Trying to Load Compiled Extension

[email protected] (Nicholas Williams)
Newsgroups php.pecl.dev
Message-ID <[email protected]>
You were right, my .so does not have get_module():

$ nm -o rawsockets.so
rawsockets.so: 00000000 s __mh_bundle_header
rawsockets.so:          U dyld_stub_binder

However, in my source file rawsockets.c, I have the following:

#ifdef COMPILE_DL_RAWSOCKETS
ZEND_GET_MODULE(rawsockets)
#endif

Which is nearly identical to that in the sockets extension, sockets.c:

#ifdef COMPILE_DL_SOCKETS
ZEND_GET_MODULE(sockets)
# ifdef PHP_WIN32
# include "zend_arg_defs.c"
# endif
#endif

And after phpize and configure I can grep the directory and find 
COMPILE_DL_RAWSOCKETS in about a dozen files. Just to be safe, however, 
I commented out #ifdef COMPILE_DL_RAWSOCKETS and it nm -o rawsockets.o 
still doesn't report a get_module() available. *scratches head*

N

Rasmus Lerdorf wrote:
> Nicholas Williams wrote:
>   
>> for Mac OS X Snow Leopard 10.6.2. It compiles without error and says
>> that the extension has been copied to the proper directory. However, if
>> I try to load the extension either with dl('rawsockets.so') or
>> extension=rawsockets.so in the INI file, I get the error "PHP Warning: 
>> PHP Startup: Invalid library (maybe not a PHP library) 'rawsockets.so' 
>> in Unknown on line 0 phpinfo()". If, per some suggestions I found
>> online, I try to load it with
>> zend_extension=/usr/lib/php5/extensions/rawsockets.so, I get the error
>> "/usr/lib/php5/extensions/rawsockets.so doesn't appear to be a valid
>> Zend extension."
>>     
>
> This happens when your .so does not have get_module().
>
> Check it with:
>
> nm -o rawsockets.so | grep get_module
>
> -Rasmus
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.