php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35848 Failing when including --with-mysql
Submitted: 2005-12-30 06:38 UTC Modified: 2007-02-09 10:17 UTC
Votes:72
Avg. Score:4.5 ± 0.9
Reproduced:70 of 70 (100.0%)
Same Version:28 (40.0%)
Same OS:19 (27.1%)
From: shawn dot richards at ink dot ltd dot uk Assigned: andrey (profile)
Status: Not a bug Package: MySQL related
PHP Version: 5CVS-2005-12-30 (snap) OS: Mac OS X Tiger.
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 + 39 = ?
Subscribe to this entry?

 
 [2005-12-30 06:38 UTC] shawn dot richards at ink dot ltd dot uk
Description:
------------
Mac OS X patched up to date. Apache 2. PHP 5 (latest snap) 
Compilation with --with-mysql option fails. 

Have tried compiling with MySQL 4.x Standard, 5.x Standard 
(preferred) and 5.x Debug. Same error every compilation even 
though MySQL works every time.

Reproduce code:
---------------
./configure --with-apxs2=/usr/local/apache/bin/apxs --enable-bcmath --enable-debug --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/local/lib

Expected result:
----------------
Successful compile.

Actual result:
--------------
Configure script fails with.......

checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... 
no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check 
config.log for more information.

--------------------------------------------

Config Log says.........

configure:58617: checking for MSSQL support via FreeTDS
configure:59267: checking for MySQL support
configure:59313: checking for specified location of the 
MySQL UNIX socket
configure:59370: checking for MySQL UNIX socket location
configure:59556: checking for mysql_close in -lmysqlclient
configure:59575: gcc -o conftest -g -O2  -no-cpp-precomp -L/
usr/local/mysql/lib -L/usr/local/mysql/lib  conftest.c -
lmysqlclient  -lz -lm  -lxml2 -lz -liconv -lm -lxml2 -lz -
liconv -lm 1>&5
/usr/bin/ld: truncated or malformed archive: /usr/local/
mysql/lib/libmysqlclient.a (ranlib structures in table of 
contents extends past the end of the table of contents, 
can't load from it)
collect2: ld returned 1 exit status
configure: failed program was:
#line 59564 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  
*/
/* We use char because int might match the return type of a 
gcc2
    builtin and then its argument prototype would still 
apply.  */
char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:59796: checking for mysql_error in -lmysqlclient
configure:59815: gcc -o conftest -g -O2  -no-cpp-precomp -L/
usr/local/mysql/lib -L/usr/local/mysql/lib  -L/usr -L/usr 
conftest.c -lmysqlclient  -lz -lz -lm  -lxml2 -lz -liconv -
lm -lxml2 -lz -liconv -lm 1>&5
/usr/bin/ld: truncated or malformed archive: /usr/local/
mysql/lib/libmysqlclient.a (ranlib structures in table of 
contents extends past the end of the table of contents, 
can't load from it)
collect2: ld returned 1 exit status
configure: failed program was:
#line 59804 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  
*/
/* We use char because int might match the return type of a 
gcc2
    builtin and then its argument prototype would still 
apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-30 16:41 UTC] shawn dot richards at ink dot ltd dot uk
Found the problem. The PHP compile fails when using this 
version of MySQL: Mac OS X 10.4, (PowerPC, 64-bit)

I have a 64-bit machine and the PHP compile process freaks out 
at some point because the ranlib returns strange results since 
data somewhere exceeds the expected 32-bits.

This is a legitimate bug, which might not exist in the PHP 
compiler...but the compile process fails.
 [2005-12-31 00:42 UTC] sniper@php.net
Assigned to Mysql support.
 [2006-03-07 21:05 UTC] thijs dot wijnmaalen at gmail dot com
You could fix this issue by changing the config line to:
--with-mysql=shared (thanks to YorHel)
 [2006-04-19 17:01 UTC] pamelastone at gmail dot com
The problem is fixed when using 
--with-mysql-dir=/usr/local/mysql

instead of 
--with-mysql=/usr/local/mysql
 [2006-04-20 10:09 UTC] pfroling at hotmail dot com
Thank you pamelastone. That fixed my configure problem.
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql-dir=/usr/local/mysql --with-zlib-dir=/usr
 [2006-05-02 22:23 UTC] ivanick at vet dot upenn dot edu
Same bug on RH4.2 AMD64 as well, fix works (with-mysql-dir), my many thanks!
 [2006-05-15 13:57 UTC] vktechnology at uk2 dot net
The problem is fixed when using 
--with-mysql-dir=/usr/local/mysql

instead of 
--with-mysql=/usr/local/mysql
********************************
cannot fix,
after install will cannot connect to my sql by using PHP
you will see this error

"Fatal error: Call to undefined function mysql_connect() "

and looking in info.php
cannot see mysql too...
 [2006-05-15 14:17 UTC] tony2001@php.net
Sure. Because there is no such ./configure option like "--with-mysql-dir".
 [2006-05-17 01:36 UTC] rsmiderle at gmail dot com
"exactly
the problem is fixep by --with-mysql-dir=/path_to_mysql"

I used this workaround and was able to compile everything, but 
I don't have mysql built into PHP.  When I run: 

function_exists( 'mysql_connect' )
 
it returns false.  Did anyone else get this problem?  (I may 
have messed up the install in some other way, it's my first 
time installing)
 [2006-05-17 02:53 UTC] tbednarek at gmail dot com
I also cannot use any of the MySQL functions as it tells me that the extension could not be loaded.

I tried both with --with-mysql=shared and --with-mysql-dir=/usr/local/mysql.
 [2006-05-17 06:25 UTC] tony2001@php.net
There is NO SUCH ./configure OPTION like --with-mysql-dir.
Please stop adding useless comments to the report.
 [2006-05-18 16:03 UTC] vktechnology at uk2 dot net
still don't know how to fix this
now I moved to use php 64 bit PHP RPM fedora

I install webmin and download
php-5.1.2-5.x86_64.rpm
http://fr2.rpmfind.net/linux/RPM/index.html

it work for me..
but i prefer ito compile form source..
 [2006-05-18 16:10 UTC] pajoye@php.net
For linux 64 bits system you need to add:

  --with-libdir=/lib64 to your configure line

Please ask further support questions to the php installation mailing list. This is not a support medium.


 [2006-06-03 20:19 UTC] svetlovid at mail dot ru
2 linuxrulez at bk dot ru

Tnx man! All working fine!

I have the same problem.

Arch: i686
OS: Linux Slackware Current (04.06.2006)
MySQL: 5.1.9 beta
Apache 2.2.2
PHP ver. 5.1.4
have a installed glibc 2.3 after installing OS
(minimum installation, but i've check for glibc - its already there)

I have just download next one:
mysql-5.1.9-beta-linux-i686-glibc23.tar.gz
- making a standart installation procedure
- making auto up/down script for system rebooting case.

then install PHP 5.1.4 with this string:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --with-mysql=/usr/local/mysql --with-gd --with-apxs2=/usr/local/apache2/bin/apxs --enable-ftp --enable-mbstring --with-zlib

and all working DONE!!
Realy tnx!

Best regards,
Oleg
 [2006-06-20 15:47 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-06-22 14:34 UTC] valentijn at depagter dot com
I'm currently experiencing the same problem, with any combination of the following:

Apache v2.2.2
MySQL v5.0.22 & v5.1.11-beta-i686
PHP 5.1.4 & 5.2 Snapshot (200606221230)

Configuration output:
---------------------
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.
---------------------

Tried it with both 5.1.4 and the latest snapshot, which unfortunately does not resolve the issue.

I can confirm that using MySQL v5.0.18 instead of 5.0.22 or 5.1.x does work.

I think it is the same as, or at least related to the following bug: http://bugs.mysql.com/bug.php?id=19817

Every MySQL version below 5.0.20 seems to be unaffected.
 [2006-06-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-06-29 16:49 UTC] javier at nediam dot com dot mx
I faced the same problem with the binary distribution of MySQL 5.0.22. Instead I try with the source distribution (of the same version 5.0.22) and It worked :)
 [2006-07-11 17:06 UTC] down at townsquirrel dot de
I've the same problem:

Both verions (binary and self-compiled sourcecode) of MYSQL 5.0.22 didn't worked pretty !

Using 5.0.18 solved the problem
 [2006-07-27 16:04 UTC] c00lways at gmail dot com
anyone going to help on this?

i've faced the same problem with mysql 5.0.22 with php 5.1.4...

the problem has been reported on mysql support website, but yet, no one have got the solutions to it.

i think it's due to libmysql...

when i tried to compile using --with-mysqli=/usr/local/mysql/bin/mysql_config

it states something to do with invalid version of libmysql..

my box was just freshly installed mysql 5.0.22...

and now attempting to compile the php 5.1.4

example:

--with-mysql=/usr/local/mysql  --with-gd \
--enable-embedded-mysqli \
--with-gd2 --with-openssl --with-sockets \
--enable-mbstring --enable-ftp --enable-sockets \
--with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib \
--with-zlib-dir=/usr/lib
 [2006-07-27 16:06 UTC] c00lways at gmail dot com
i've checked on the changelog of mysql...

from mysql 5.0.18 to 5.0.22
almost all of them are security fixes...

this could be a security treat for all existing mysql 5.0.22 and below
 [2006-07-28 00:58 UTC] c00lways at gmail dot com
i've tried to build mysql 5.0.22 with sources..

and use my configure line for php as:

./configure \
--with-mysql=/usr/local/include/mysql  \
--with-gd \
--enable-embedded-mysqli \
--with-gd2 --with-openssl --with-sockets \
--enable-mbstring --enable-ftp --enable-sockets \
--with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib \
--with-zlib-dir=/usr/lib 

** and it works!
 [2006-08-17 21:30 UTC] hongda dot yen at gmail dot com
Do not use use the Mysql binary distribution.
Installing with a source distribution maybe You'll avoid this problem.
 [2006-08-24 11:33 UTC] Tetonne at tiscali dot fr
sucess to install apache 2.2.2 and php 5.14 but php doens't work here (I have installed apache here /Library/apache2) like it used to be with Complete release.
any php page is downloaded but not load.??

5.1.15 is out any update with a simple way to install a working apache 2.2x, php 5.1.x mysql 5.x would be great
other sites : www.entropy.ch and www.macosxhints.com
 [2006-09-28 10:57 UTC] rafudu at gmail dot com
I was having the same trouble..so I've checked the md5sum of my Mysql tarball and it was corrupted. So, I've downloaded and installed again and it worked.
:D
 [2006-10-29 23:30 UTC] davxoc at hotmail dot com
Hi everybody!!!, I had the same problem, but looking for and answer I found two things that can help me to solve it...

The first one is located on http://lists.mysql.com/internals/34023

On this link explain which is the problem of integration of mysql, and give an answer ...

http://dev.mysql.com/downloads/os-linux.html

I had to download the libraries, after tried a lot, and reading the man's help from php config file (configure --help), found the solution.

Finally those are the lines to compile my LAMP AND LAPP "framework's"....

./configure --prefix=/usr/local/php5  --with-apxs2=/usr/local/web/bin/apxs --enable-sockets  --with-config-file-path=/usr/local/php5 --with-mysql-dir=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-zlib-dir=/usr/local/zlib-1.2.3  --with-libdir=/usr/local/intel-icc8-libs-8.1-i386


and tha's all!!!
I hope that can help!!...
 [2006-11-17 14:25 UTC] furyx001 at umn dot edu
Has there been any update on the status of this?  I was able to reproduce this as well on OS 10.4.8 Server using the 64 bit edition of MySQL (which I installed from a package).
 [2006-11-21 16:43 UTC] nicolasboulet at maisonlaprise dot com
Thanks alot!
The with-mysql-dir= command also fixed my problem on Suse Linux 10.1. Many thanks!
Nicolas
 [2007-01-09 20:14 UTC] dweller at devonweller dot com
I experienced this same problem on Mac OS X 10.4 with the 64 bit package of MySQL 5.0.27.

I installed the 32-bit version of MySQL 5.0.27.  After that, the php compilation worked successfully.
 [2007-01-29 18:00 UTC] colin dot anderson at red-man dot com
You're getting this problem because the MySQL >>binaries<< do not come with certain libraries that are created when you build from source on INTEL systems.

To resolve this problem, you need to download the appropriate libraries.

Visit >> http://dev.mysql.com/downloads/os-linux.html

And grab the appropriate library for your server.  All of the latest MySQL releases are compiled with the ICC9 libraries; so grab those for your appropriate architecture.

This should solve your problems; as stated repeatedly above, --WITH-MYSQL-DIR[=DIR] WILL NOT WORK.  :P
 [2007-02-01 10:59 UTC] milnivlek at gmail dot com
I think I've figured out the definitive solution for this problem (at least for most people):

If you're building PHP for an x86 server, this problem apparently always occur when you use the 'Linux (x86, glibc-2.2, "standard" is static)' binary distribution from the MySQL download page.  Simply use the 'Linux (x86)' distribution instead, and the problem should go away.

(The 'Intel C/C++ compiled' version doesn't seem to work either, so stick with the regular one.)

Hope this helps.
 [2007-02-09 07:36 UTC] zelzel dot zsu at gmail dot com
I meet the same problem.

Why php comminity distributed this full of known bugs programs.

You even can not get a chance to install on your server.

It's really frustrated and anoying.
 [2007-02-09 10:17 UTC] tony2001@php.net
.
 [2012-11-12 12:43 UTC] varun1884 at gmail dot com
I faced the same error with following
OS    : RHEL5 64-bit
Apache: 2.4.3
PHP   : 5.4.8
MySQL : 5.5.28

I found that I had installed 32-bit MySQL instead of 64-bit. When I replaced the 
MySQL 32-bit by MySQL 64-bit the problem was solved.
 [2016-07-11 20:15 UTC] lsastha at outlook dot com
For a legacy installation, the problem got resolved in RHEL 6 after installing these RPMs:


rpm -ivh  MySQL-shared-compat-advanced-5.6.14-1.el6.x86_64.rpm

rpm -ivh  MySQL-shared-advanced-5.6.14-1.el6.x86_64.rpm

Just the first one is enough I guess, but I installed both.

Refer: https://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC