On Tuesday, June 12, 2001, at 10:29 am, Wilfredo Sanchez wrote:
> I think something is wrong with how things are built; the same symbol
> should not exist twice. I have very little experience with MySQL, even
> less with Perl and MySQL. However, I do remember something about PHP;
> that if you build PHP without MySQL support, that it builds in its own
> stub or some such, and adding MySQL later has conflicts.
I noticed something about this in the mod_php docs, but it shouldn't
apply to me: I built everything (perl, mysql, apache, mod_perl, mod_php,
DBI, DBD::MySQL) myself.
I built php with mysql support, against my mysql build (rather than the
included stub). Similarly, DBD::MySQL was built against the same mysql
build. Looking at the makefiles, they seem to be linked against the same
library:
/usr/local/mysql/lib/mysql/libmysqlclient.a
mod_php and DBD::MySQL are built completely independently - they only
end up inside apache together because mod_perl loads the DBD::MySQL
module into the httpd process when its first used.
I know very little about linking, but I guess the only way to avoid a
conflict in these circumstances would be for the linker to check what
libraries it was about to load, and to say, ahah, I've got that one
already.
I ran 'otool -L' against the binaries for mod_php and DBD::MySQL, and
they produce the following:
% otool -L /usr/local/apache1.3.19/libexec/libphp4.so
/usr/local/apache1.3.19/libexec/libphp4.so:
/usr/lib/libz.1.1.3.dylib (compatibility version 1.0.0, current
version 1.1.3)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 50.0.0)
% otool -L
/Library/Perl/site_perl/5.6.1/darwin/auto/DBD/mysql/mysql.bundle
/Library/Perl/site_perl/5.6.1/darwin/auto/DBD/mysql/mysql.bundle:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 50.0.0)
/usr/lib/libz.1.1.3.dylib (compatibility version 1.0.0, current
version 1.1.3)
It looks as though they are statically linked against the mysqlclient
library. Could this be the source of the problems?
cheers,
Martin