problems with dynamically compiled php extensions ERROR: Warning: Invalid library (maybe not a PHP library)

From: Date: Thu, 21 Oct 2004 15:17:02 +0000
Subject: problems with dynamically compiled php extensions ERROR: Warning: Invalid library (maybe not a PHP library)
Groups: php.install 
Request: Send a blank email to php-install+get-14565@lists.php.net to get a copy of this message
hi i use these two commands to compile the extension cc -fpic -DPTHREADS -DZEND_DEBUG=0 -DZTS=1 -DCOMPILE_DL=1 -I/usr/local/include -I/usr/local/include/php/ext/standard -I/usr/local/include/php -I/usr/local/include/php/main -I cimd/cimd_lib/ -I /usr/local/include/php/TSRM -I/usr/local/include/php/Zend -c -o cimd.o cimd/cimd.cpp cc -shared -rdynamic -L/usr/local/lib/php -o cimd.so cimd.o the compilation returns a success, but if i run a little php script to load my extension with the dl() function or if i load it in the php.ini file this error message is printed: "Warning: Invalid library (maybe not a PHP library) 'cimd.so'" nm cimd.so | grep module prints followed lines out =============== output ================ 00001b00 D firstmod_module_entry 00000928 T _Z10get_modulev 00000940 T _Z16zif_first_moduleiP12_zval_structS0_i ==================================== can you help me ? i searched the whole php-dev newsgroup and many people have the same problem. my php version is 4.2.2 gcc version 2.96-81 ========================== CODE BEGIN =========================== #include "php.h" #include "php_config.h" #include "info.h" /* All the functions that will be exported (available) must be declared */ ZEND_FUNCTION(hello_world); PHP_MINFO_FUNCTION(devarticlesmod); /* Just a basic int to be used as a counter*/ int i; /* function list so that the Zend engine will know what's here */ zend_function_entry devarticlesmod_functions[] = { ZEND_FE(hello_world, NULL) {NULL, NULL, NULL} }; /* module information */ zend_module_entry devarticlesmod_module_entry = { STANDARD_MODULE_HEADER, "DevArticles", devarticlesmod_functions, NULL, NULL, NULL, NULL, PHP_MINFO(devarticlesmod), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; ZEND_GET_MODULE(devarticlesmod) PHP_MINFO_FUNCTION(devarticlesmod) { php_info_print_table_start(); php_info_print_table_row(2, "DevArticles Extension", "All Systems Go"); php_info_print_table_end(); } ZEND_FUNCTION(hello_world) { for(i=0;i<5;i++) { zend_printf("Hello World<br>"); } } =================================== CODE END ==================================

« previous php.install (#14565) next »