I need some help with a module in PHP

From: Date: Tue, 30 May 2000 21:04:46 +0000
Subject: I need some help with a module in PHP
Groups: php.dev 
Request: Send a blank email to php-dev+get-19811@lists.php.net to get a copy of this message
Hi, I'm sorry if this is not the place to post it, but I don't know where to search anymore. I'm trying to make a module to be included in a php script with the dl command. I have php 4.0.0 with apache 1.3.12 in a sun solaris 2.6 I configured the php with: ./configure --with-apache=../apache_1.3.12 \ --with-oci8=/usr/local/oracle/product/8.0.6/ \ --enable-track-vars \ --enable-trans-sid \ --with-config-file-path=/usr/local/lib \ --with-maro=shared and I have this c code for the module maro: #if defined(COMPILE_DL) # include "dl/phpdl.h" #endif #include "php.h" PHP_FUNCTION(maroprint); static zend_function_entry php_maro_functions[] = { PHP_FE(maroprint, NULL) {NULL,NULL,NULL} }; zend_module_entry maro_module_entry = { "maro", php_maro_functions, NULL, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES }; DLEXPORT zend_module_entry *get_module() { return &maro_module_entry; }; PHP_FUNCTION(maroprint) { printf ("Mariano M. Fernandez"); RETURN_TRUE; } I compile the module with workshop 4.2 (the solaris c/c++ compiler): CC -G -o maro.so maro.c \ -I/opt/src/php-4.0RC1 -I/opt/src/php-4.0RC1/Zend \ -h maro.so.1 \ -lC also I had modify the php.ini in this statements: extension_dir = /path_to_the_maro.so/ and added thisone: extension=maro.so so, I try to link this library with: <? dl("maro.so"); ?> and I get this: Warning: Invalid library (maybe not a PHP library) 'maro.so' in Unknown on line 0 I think that I'm missing something but I don't know what. I will really apreciate your help. Thanks in advance. Mariano Fernandez mmfernandez@bumeran.com

« previous php.dev (#19811) next »