php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36073 Source-compiled MySQL on x86_64 causes PHP configure failure
Submitted: 2006-01-18 22:14 UTC Modified: 2010-10-28 09:51 UTC
Votes:11
Avg. Score:4.0 ± 1.1
Reproduced:8 of 9 (88.9%)
Same Version:5 (62.5%)
Same OS:5 (62.5%)
From: chris at spawnordie dot com Assigned: mysql (profile)
Status: Wont fix Package: MySQL related
PHP Version: 5.3.2 OS: Linux/Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-01-18 22:14 UTC] chris at spawnordie dot com
Description:
------------
Please accept my apologies if this is already reported - I searched and didn't find it.

When configuring PHP for x86_64, it is necessary to use:
--with-libdir=lib64

When you compile MySQL from source, it does not place its files in lib64, but rather lib.

MySQL was configured using:
--prefix=/usr/local/mysql

Configuring PHP using:
--with-mysql=/usr/local/mysql
fails with this:
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!

This fixes the problem:
cd /usr/local/mysql
ln -s lib lib64

When PHP is configured using --with-mysql=<mysql_dir> and --with-libdir=<lib_dir>, it should search <mysql_dir>/<lib_dir> and then <mysql_dir>/lib

Reproduce code:
---------------
./configure --with-mysql=<path/to/mysql> when MySQL is compiled from source code

Expected result:
----------------
successful configure

Actual result:
--------------
configure fails with:
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-18 23:53 UTC] sniper@php.net
Works fine for me.
Hint: Don't try building Mysql yourself if you don't know how to do it properly. Use the binary packages provided by MySQL.
And last but not least: report this to MySQL. It's not our fault if they do things wrong.
 [2010-03-25 18:32 UTC] michael at michaelsnet dot us
IMHO this is a documentation bug.  Consider adding a README.64bit file containing this information and other relevant information.
 [2010-03-25 23:16 UTC] chris at spawnordie dot com
Other than the bug reviewer just being a flat-out ass...

It is still a bug in PHP.  The PHP configure process honors the "--with-libdir" 
value for PostgreSQL and many, many other packages, but NOT for its check of 
MySQL.  It is NOT a bug in MySQL, which installs its libraries in lib64, just 
like every other application that is compiled for 64bit OS.  But PHP somehow 
"magically" knows how to find all of those other applications.  At the very 
least, it is an inconsistency that could have been cleaned up with 15 minutes of 
effort by the PHP team when I reported the bug 4 years ago!

And, based on the fact that I provided a work-around, it should have been clear 
that I did, in fact, know what I was doing.  Maybe my feelings were a little 
hurt, but there's no excuse for the rudeness this bug reviewer showed.  I 
sincerely hope that he/she is no longer in that role -- or doing anything that 
requires using any level of tact with actual people -- because he/she is just a 
jerk and is in serious need of therapy.  Maybe he/she didn't get hugged as a 
child and is displaying a superiority complex to cover up low self-esteem and 
fear of being hurt.  But I digress.
 [2010-06-06 02:29 UTC] everyminutepies at yahoo dot ca
I can confirm that this does in fact still happen with PHP 5.3.2 on CentOS 5.5 86_64 when compiling MySQL 5.0.xx and PHP on a standard installation. Despite being told by the configuration option --with-libdir=lib64 to use lib64/ it still chooses to use lib/ and fails to find the necessary files to continue with the ./configure.



The posted workaround by Chris does work flawlessly. I invite the reviewer to explain either why the documentation is incorrect about the function of --with-libdir or why it is not respected in regards to mysql at his leisure. 

Trustfully, I agree not to become enraged when he suggests I know nothing about computers and post an enraged rant about him in the year 2014.



./configure  --prefix=/usr/local/secure/php --with-apxs2=/usr/local/secure/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libdir=lib64
 [2010-06-06 08:10 UTC] philip@php.net
-Status: Wont fix +Status: Open -Package: Compile Failure +Package: MySQL related -PHP Version: 5.1.2 +PHP Version: 5.3.2
 [2010-06-06 08:10 UTC] philip@php.net
Looks like a bug.
 [2010-06-20 20:04 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mysql
 [2010-10-28 09:50 UTC] andrey@php.net
-Status: Assigned +Status: Wont fix
 [2010-10-28 09:50 UTC] andrey@php.net
ext/mysql has been deprecated in favor of ext/mysqli. ext/mysqli gets only security fixes. Either use the workaround or switch to using mysqlnd.
 [2010-10-28 09:51 UTC] andrey@php.net
Erm, I meant that ext/mysql gets only security fixes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 05:01:27 2024 UTC