MonetDB extension

php.internals

Manfred Stienstra

22 years ago
Hi, I guess I should introduce myself first: I'm Manfred Stienstra, I'm a parttime web application programmer and parttime student Artificial Intelligence. I was asked by a teacher to create a php api for MonetDB [1], I started working on that today, and I can't find out how to create a dynamic loadable extension. The code I'm using is the standard code from ext_skel. I've tried this: gcc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I ../.. -I../../Zend -I../../include -I../../main -I../../TSRM -c -o monet.o monet.c ld --export-dynamic -shared -L/usr/lib -o monet.so monet.o but php gives this error: Warning: dl(): Invalid library (maybe not a PHP library) 'monet.so' in /var/www/tail.dwerg.net/htdocs/monet/index.php on line 3 Is there some way to use the php build structure to create dynamic loadable extensions or does someone know how to fix this? Manfred Stienstra [1] http://monetdb.cwi.nl

Robert Cummings

22 years ago
On Tue, 2003-09-23 at 11:59, Manfred Stienstra wrote:
> gcc -fpic -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I ../.. > -I../../Zend -I../../include -I../../main -I../../TSRM -c -o monet.o > monet.c
I had this problem myself recently before I figured out how to build the standalone shared module. If memory serves me correctly your above line is incorrect and should be as follows:
> gcc -fpic -DCOMPILE_DL_MONET=1 -I/usr/local/include -I. -I.. -I ../.. > -I../../Zend -I../../include -I../../main -I../../TSRM -c -o monet.o > monet.c
The change was to add _MONET to the -DCOMPILE_DL portion of the statement. HTH, Rob.
-- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

Manfred Stienstra

22 years ago
Hi, As some might remember from last week, I'm trying to develop a php extension, but I'm having a little trouble getting it compiled... /home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: `zif_monet_connect' undeclared here (not in a function) /home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: initializer element is not constant Does anyone know how I can fix this? Manfred p.s. I didn't attach the code, because I don't want to spam the list with big files.

Andrey Hristov

22 years ago
Manfred Stienstra wrote:
>Hi, > >As some might remember from last week, I'm trying to develop a php >extension, but I'm having a little trouble getting it compiled... > >/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: >`zif_monet_connect' undeclared here (not in a function) >/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: >initializer element is not constant > >Does anyone know how I can fix this? > >Manfred > >p.s. I didn't attach the code, because I don't want to spam the list >with big files. > > >
Then, please place the files somewhere on the web, so we can see the code Andrey

Manfred Stienstra

22 years ago
On Tue, 2003-09-30 at 16:56, Andrey Hristov wrote:
> Manfred Stienstra wrote: > > >Hi, > > > >As some might remember from last week, I'm trying to develop a php > >extension, but I'm having a little trouble getting it compiled... > > > >/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: > >`zif_monet_connect' undeclared here (not in a function) > >/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: > >initializer element is not constant > > > >Does anyone know how I can fix this?
> Then, please place the files somewhere on the web, so we can see the code
Here are the files: http://tail.dwerg.net/monet/monet.c http://tail.dwerg.net/monet/php_monet.h http://tail.dwerg.net/monet/config.m4 Manfred

Andrey Hristov

22 years ago
Manfred Stienstra wrote:
>On Tue, 2003-09-30 at 16:56, Andrey Hristov wrote: > > >>Manfred Stienstra wrote: >> >> >> >>>Hi, >>> >>>As some might remember from last week, I'm trying to develop a php >>>extension, but I'm having a little trouble getting it compiled... >>> >>>/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: >>>`zif_monet_connect' undeclared here (not in a function) >>>/home/dwerg/code/2003/monetdb/php-4.3.3/ext/monet/monet.c:42: error: >>>initializer element is not constant >>> >>>Does anyone know how I can fix this? >>> >>> > > > >>Then, please place the files somewhere on the web, so we can see the code >> >> > >Here are the files: > >http://tail.dwerg.net/monet/monet.c >http://tail.dwerg.net/monet/php_monet.h >http://tail.dwerg.net/monet/config.m4 > >Manfred > > >
I see something bad in php_monet.h : PHP_FUNCTION(mysql_connect); PHP_FUNCTION(mysql_close); As you probably see this you misspelled the names. Andrey

Manfred Stienstra

22 years ago
> I see something bad in php_monet.h : > > PHP_FUNCTION(mysql_connect); > PHP_FUNCTION(mysql_close); > > As you probably see this you misspelled the names.
Oops, sorry to have bothered you with this... Manfred