I'm hoping to gradually transition my FreeBSD 4.7 web server from MySQL 3.23 and PHP 4.3 to MySQL 4.1.7 and PHP 5.0.2. I've successfully installed MySQL 4.1.7 into a separate directory and given it a distinct port and Unix socket, and it seems to be running happily alongside its older counterpart.

The problem arises when I attempt to configure PHP 5.0.2 from source. I'm trying to specify the version of MySQL to use by specifying to configure:

./configure --with-mysql=/usr/local/mysql4 --with-mysqli=/usr/local/mysql4/bin/mysql_config

But configure errors out with:

checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check config.log for more information.


Looking at config.log reveals that configure is attempting to link to MySQL using a command like:

gcc -o conftest -g -O2 -R/usr/local/lib/ -L/usr/local/lib -R/usr/local/mysql4/lib/mysql -L/usr/local/mysql4/lib/mysql ...

I believe the problem is that configure is searching /usr/local/lib before it searches /usr/local/mysql4/lib/mysql, and so it is linking with the older MySQL 3.23 libraries. It seems to prepend /usr/local/lib to the library search path between the check for mysql_close and the check for mysql_set_server_option. I'm not sure why.

Does someone know of a way to convince configure to keep /usr/local/mysql4/lib/mysql before /usr/local/lib in the search path, so it will find the right libraries?


Thanks,

--Stuart A. Malone
  Llamagraphics, Inc.

Reply via email to