Re: Trying to Load Compiled Extension
| From: | Nicholas Williams | Date: | Mon, 08 Feb 2010 12:02:25 +0000 |
| Subject: | Re: Trying to Load Compiled Extension | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-7008@lists.php.net to get a copy of this message | ||
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_binderHowever, 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