Posted by Richard Lynch on 01/07/05 19:31
> 1) Does adding 'shared,' as a ./configure option mean the module is
> as an external, dynamically loaded module as compared to the module being
> statically linked into the 'exe' file? So that adding 'shared,' means I
> add a line in the PHP ini file to load the extension (or load with a
'shared' ==> .dll or .so dynamic library to load in
'static' ==> library is bundled into php binary
> 2) When configuring PHP with mysql support by something like
> '--with-mysql=/usr' does it automatically create a shared module? i.e do
> both these following configs produce the same result '--with-mysql=/usr'
'shared' creates the DLL/.so and you need to load it.
absence of 'shared' means it's bundled in.
> The reason I ask, is I see many PHP info pages that specify
> '--with-mysql=[DIR]' without the 'shared,' bit, and they do specify an
> external library with the [DIR] part, but in the mysql info section
> 'MYSQL_MODULE_TYPE' shows as 'external'. I thought 'shared,' would have to
> be added to create an external dynamic loaded module?
'external' versus 'built-in' is another wrinkle.
Here's how I understand it:
'shared' versus 'static' is the usual for libraries.
There's a MySQL guy on the PHP team, who also provides a 'built-in' versus
He basically maintains a copy of the MySQL library *directly* in PHP
So it breaks down like:
Built-in -- source code *in* PHP source
External -- usual deal of source code from MySQL
static -- bundle MySQL library into php binary
shared -- create DLL/.so library to be loaded in
I don't think the static/shared option has any meaning under 'Built-in' --
'Built-in' is kind of like static inherently, only even more so.
I'm not sure of the benefits of 'built-in'...
Convenience of not needing to get ./configure to find MySQL source???
Bragging rights for PHP and MySQL??? :-)
The downside is that you'be *GOT* to run the exact same version of MySQL
that is built-in to PHP source -- If that's on 4.x.y and you're running
4.x.(y+1) don't go there. If you manage to get it to run, you'll run this
risk that eventually you'll run across that *one* function that changed
betwween y and (y+1) and "Bam!" you've got a nasty bug.
The pros and cons of 'static' versus 'shared' are pretty well-documented
elsewhere and are common enough to enough modules and other software
packages with the same structure.
But 'built-in' versus 'external' I'm not sure if that's been documented
why/when... Maybe Google for it.
[Reply to this message]