MapTools.org

[maplab-users] The misterious dbase.so problem with MapLab

Paul Spencer spencer@dmsolutions.ca
Tue, 30 Mar 2004 22:02:22 -0500
Emilio, I will attempt to explain how php extensions work and how maplab 
(and other dmsolutions code) interacts with them.

PHP extensions can be built in two separate ways: statically or 
dynamically linked (that may not be the correct terminology).  If built 
statically then the module is part of the php executable and is always 
loaded when php is executed.  If built dynamically built then the 
extension is only available if requested at run time.  It can be 
requested at run time in two ways: 1. in the php.ini as part of the 
[extensions] section and 2. in php code using the dl() function. 
Loading a module twice generates errors so PHP provides a function 
(extension_loaded()) that checks to see if a module is loaded ... but it 
is up to the developer to call that function before using the dl() function.

It is possible to write bad code that either assumes the existence of a 
module or loads it without checking.  There was (at one point) a problem 
like this in MapLab relating to the dbase module so it is possibly related.

When MapLab runs it *should* be checking to see if the dbase extension 
is loaded before requesting to load the dbase.so module.  In your case I 
think you have statically linked the dbase.so module into php so it 
should never actually do the dl() call.

I think to find the source of the problem, you will have to search the 
code.  You will need to run grep and search for 'dbase.so' then inspect 
each of the files you find this in to see if it is checking to see if 
the extension is loaded first.

Because you have dbase statically linked, you can fix the problem by 
commenting out the offending lines of code (add // to the beginning of 
the line reading dl( 'dbase.so' );)

Hope this helps,

Paul



Emilio Giulio Orsenigo wrote:

> Hi all,
> i'm experiencing a strange problem installing and running maplab.
> I've read all the related material that i've found here on maplab-users 
> and via google, but i'm still stuck at the problem.
> 
> All is around the dbase.so shared library.
> I'm trying to set up MapLab over my RH9 server, with apache,php and 
> mapserver already up and running perfectly.
> I've followed all the directive in the readme file of maplab but... i'm 
> still blocked.
> MapLab search for an dbase.so library as required, and i'm unable to 
> find how to build/obtain this library.
> I've already re-configured and re-compiled php with the --enable-dbase 
> option, but the dbase.so simply don't appear.
> I've read around on the web that the dbase support does not need a 
> standalone shared library file, but it is simply enough to put on 
> --enable-dbase in configuring/compiling php. That is, it does not work 
> for me. (and i may understand: the php code search for the file, but i 
> haven't)!
> I'm going crazy for this problem since a week... please, someone help me 
> to understand this magic! I really don't know how to proceed now ...
> 
> thanks in advance
> 
> Emilio
> _______________________________________________
> Maplab-users mailing list
> Maplab-users@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/maplab-users
> 

-- 
  -----------------------------------------------------------------
|Paul Spencer                           spencer@dmsolutions.ca    |
|-----------------------------------------------------------------|
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
  -----------------------------------------------------------------



This archive was generated by Pipermail.