RE: [PHP-DEV] I need some help with a module in PHP
| From: | Mariano Fernandez | Date: | Thu, 01 Jun 2000 14:01:34 +0000 |
| Subject: | RE: [PHP-DEV] I need some help with a module in PHP | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-19969@lists.php.net to get a copy of this message | ||
I just found what was the error....
the code I showed before was a simplification off course, only as an
example. But the thing is that my code should be compiled with C++. And
that's the problem.
Anyone knows what should I do when I need to load a module that it's
compiled with C++?
I need this because I must link some shared objects that was compiled with
c++ and it doesn't work in c.
-----Mensaje original-----
De: Mariano Fernandez [mailto:mmfernandez@bumeran.com]
Enviado el: Tuesday, May 30, 2000 6:05 PM
Para: php-dev@lists.php.net
Asunto: [PHP-DEV] I need some help with a module in PHP
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
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net