dl(): Invalid library (maybe not a PHP library)
| From: | Anas Mughal | Date: | Thu, 04 Dec 2003 19:56:41 +0000 |
| Subject: | dl(): Invalid library (maybe not a PHP library) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-171885@lists.php.net to get a copy of this message | ||
I have followed the instructions in the PHP documentation on how to build a custom dynamic extension. After running ext_skel, I did NOT add any custom methods. I built the extension using the followind commands:
Compiling cc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I../Zend -c -o <your_object_file> <your_c_file>
Linking cc -shared -L/usr/local/lib -rdynamic -o <your_module_file> <your_object_file(s)>
Now, when I try to load my extension using dl(), I get the following error:
dl(): Invalid library (maybe not a PHP library) 'my_ext.so'
When, I do "nm" on the library file, I can see the method "zif_confirm_my_ext_compiled" along with other methods. So, it looks like a valid library.
Do I need to add something to the php.ini file? Well, I tried adding
extension_dir=/usr/local/apache/htdocs
extension=my_ext.so
That did NOT help either.
Could someone please advise on why PHP 4.3.3 is complaining that it is not a valid PHP extension. Did I miss anything?
Thank you in advance.
--
Anas Mughal
Email: am786@optonline.com