Failing when including --with-mysql

sundog315發表於2006-08-14

[@more@]

[30 Dec 2005 6:38am 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; }

[30 Dec 2005 4:41pm 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.
[31 Dec 2005 12:42am UTC] sniper@php.net
Assigned to Mysql support.
[7 Mar 9:05pm 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)
[19 Apr 5:01pm 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
[20 Apr 10:09am 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
[2 May 10:23pm UTC] ivanick at vet dot upenn dot edu
Same bug on RH4.2 AMD64 as well, fix works (with-mysql-dir), my many
thanks!
[15 May 1:57pm 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...
[15 May 2:17pm UTC] tony2001@php.net
Sure. Because there is no such ./configure option like
"--with-mysql-dir".
[17 May 1:36am 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)
[17 May 2:53am 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.
[17 May 6:25am UTC] tony2001@php.net
There is NO SUCH ./configure OPTION like --with-mysql-dir.
Please stop adding useless comments to the report.
[18 May 4:03pm 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


it work for me..
but i prefer ito compile form source..
[18 May 4:10pm 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.

[3 Jun 8:19pm 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
[20 Jun 3:47pm UTC] tony2001@php.net
Please try using this CVS snapshot:

  
 
For Windows:
 
  

[22 Jun 2:34pm 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:


Every MySQL version below 5.0.20 seems to be unaffected.
[28 Jun 1:00am 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".
[29 Jun 4:49pm 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 :)
[11 Jul 5:06pm 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
[27 Jul 4:04pm 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
[27 Jul 4:06pm 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
[28 Jul 12:58am 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!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19423/viewspace-856174/,如需轉載,請註明出處,否則將追究法律責任。

相關文章