You are here: Re: [PHP] Compiling PHP with external mySQL libraries « PHP « IT news, forums, messages
Re: [PHP] Compiling PHP with external mySQL libraries

Posted by Richard Lynch on 01/07/05 19:31

DAvid wrote:
> 1) Does adding 'shared,' as a ./configure option mean the module is
> compiled
> as an external, dynamically loaded module as compared to the module being
> statically linked into the 'exe' file? So that adding 'shared,' means I
> must
> add a line in the PHP ini file to load the extension (or load with a
> funcion
> call).


'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'
> and
> '--with-mysql=shared,/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
'external' MySQL.

He basically maintains a copy of the MySQL library *directly* in PHP
source code.

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'...
Performance gain???
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.

Like Music?



[Reply to this message]

Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация