Bug #20362 libmysql and libcrypto conflict prevents php 5.1.4 make --with-mysql
Submitted: 9 Jun 2006 15:59 Modified: 15 Jun 2006 7:46
Reporter: Mauricio Pastrana Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.022 (max) OS:MacOS (OS X 10.4.6)
Assigned to: Sveta Smirnova CPU Architecture:Any

[9 Jun 2006 15:59] Mauricio Pastrana
Description:
Following the instructions from
http://www.phpmac.com/articles.php?view=252 I downloaded and installed
apache 2.2.2 and MySQL 5.022(max), however whence you try to ./configure
--with-mysql=path php5.1.4 will stall at make.

MySQL runs no problem on its own (from the mysql package installer for
OS X), PHP 5.1.4 runs good too (when installed sans --with-mysql=path),
I have a phpinfo page up, and Apache 2.2.2 runs EVEN from the system
preferences panel, but of course no MySQL support and hence
mysql_connect is, of course, dead.

this is the complete configure line I used:

% ./configure \
% --prefix=/apache2/php \
% --with-zlib \
% --with-xml \
% --with-ldap=/usr \
% --enable-cli \
% --with-zlib-dir=/usr \
% --enable-exif \
% --enable-ftp \
% --enable-mbstring \
% --enable-mbregex \
% --enable-dbx \
% --enable-sockets \
% --with-iodbc=/usr \
% --with-curl=/usr \
% --with-mysql=/usr/local/mysql \ (optional, required MySQL)
% --with-apxs2=/apache2/bin/apxs
% sudo make

Also, there is a macaddict forum discussion on this issue, seems it
could be Intel Macs or Xcode 2.3 or a combination of both.

How to repeat:
macbuch:~ mauriciopastrana$ cd php-5.1.4
macbuch:~/php-5.1.4 mauriciopastrana$ ./configure --prefix=/apache2/php
--with-zlib --with-xml --with-ldap=/usr --enable-cli
--with-zlib-dir=/usr --enable-exif --enable-ftp --enable-mbstring
--enable-mbregex --enable-dbx --enable-sockets --with-iodbc=/usr
--with-curl=/usr --with-mysql=/usr/local/mysql
--with-apxs2=/apache2/bin/apxs

(snip)

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

macbuch:~/php-5.1.4 mauriciopastrana$ sudo make

(snip)

/usr/local/mysql/lib/libmysqlclient.a(ssl.o) definition of
_TLSv1_server_method in section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libssl.dylib(t1_srvr.o)
definition of _TLSv1_server_method
/usr/bin/ld: warning multiple definitions of symbol
_ERR_print_errors_fp
/usr/local/mysql/lib/libmysqlclient.a(ssl.o) definition of
_ERR_print_errors_fp in section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libcrypto.dylib(err_prn.o
) definition of _ERR_print_errors_fp
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
macbuch:~/php-5.1.4 mauriciopastrana$

Suggested fix:
not sure how to tackle this one.
[9 Jun 2006 16:12] Mauricio Pastrana
BTW, this has also been reported at php bugs, they sent me here.

http://bugs.php.net/bug.php?id=37756

-mp
[13 Jun 2006 16:56] Mauricio Pastrana
Environment update:

James Pelow, from phpmac.com and with whom Ive been trying to solve this issue just updated the info on http://www.phpmac.com/articles.php?view=252. His new instructions dont work either.

the original instructions can be found here (albeit for other versions, but they were essentially the same): http://www.phpmac.com/articles.php?view=251

cheers,

-mp
[14 Jun 2006 9:57] Sveta Smirnova
It looks like libcrypto version problem. Which version of libcrypto do you use? Can you compile php with mysql, but without apache (only ./configure --with-mysql=/usr/local)?
[14 Jun 2006 21:51] Mauricio Pastrana
hmmm... out of ideas on how to determine which version of libcrypto, I found the following:

macbuch:~ mauriciopastrana$ locate libcrypto
/Applications/Adobe Bridge/Bridge.app/Contents/Libraries/libcrypto.dylib
/usr/lib/libcrypto.0.9.7.dylib
/usr/lib/libcrypto.0.9.dylib
/usr/lib/libcrypto.dylib

I'm currently downloading and reinstalling mysql 5.022max and the 5.1beta to give it a try.

I just wanted to post to report that some people found a workaround, install everything under mysql 4.2.1 and then upgrade to 5.022.

It's being described here:

http://www.macaddict.com/forums/topic/83340

-mp
[14 Jun 2006 21:51] Mauricio Pastrana
hmmm... out of ideas on how to determine which version of lybcripto im using I found the following:

macbuch:~ mauriciopastrana$ locate libcrypto
/Applications/Adobe Bridge/Bridge.app/Contents/Libraries/libcrypto.dylib
/usr/lib/libcrypto.0.9.7.dylib
/usr/lib/libcrypto.0.9.dylib
/usr/lib/libcrypto.dylib

I'm currently downloading and reinstalling mysql 5.022max and the 5.1beta to give it a try.

I just wanted to post to report that some people found a workaround, install everything under mysql 4.2.1 and then upgrade to 5.022.

It's being described here:

http://www.macaddict.com/forums/topic/83340

-mp
[14 Jun 2006 22:19] Mauricio Pastrana
./configure --with-mysql=/usr/local doesnt compile! (again, at libcrypto)

/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libcrypto.dylib(err_prn.o) definition of _ERR_print_errors_fp
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

yuck

-mp
[15 Jun 2006 7:46] Sveta Smirnova
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

Your bug duplicates http://bugs.mysql.com/bug.php?id=19575
[28 Jul 2006 7:13] Ryan A
Actually. This is a bug and different from the one linked to by Sveta.
PHP 5.1 with Apache 2.2.2 breaks with MySQL 5.1 on:

libmysqlclient.a(ssl.o)(.text+0xa78):

This is on a dual processor Intel Xeon running CentOS 4.1 updated everything.

At first I thought it was because I downloaded the static build, but even the glibc23 build gives the same error. (5.1 GA release)

I already have MySQL 4.1.15 installed, and with the identical compiler flags it works flawlessly. Just not with MySQL 5.1.

./configure --prefix=/www2/usr/local --with-apxs2=/www2/bin/apxs  --with-zlib=/usr/local --enable-bcmath --with-curl --with-libxml-dir=/www2/usr/local --enable-exif --with-gd=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-ttf=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --enable-mbstring --with-mcrypt=/usr/local --with-mhash=/usr/local --with-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql2.sock --with-mm=/usr/local --with-pear

Where --with-mysql is linked to MySQL 4.1
[28 Jul 2006 10:06] Sveta Smirnova
Thank you, Ryan for the additional information.

But what version of MySQL 5.1 do you use? Can you repeat the problem with minimal PHP configuration such as: ./configure --prefix=/users/ssmirnova/php5.2b --without-pear --with-mysql=/users/ssmirnova/mysql5.1b --with-apxs2=/users/ssmirnova/httpd-2.2.3b/bin/apxs ? I can not with PHP 5.2 snapshot built June, 28, httpd-2.2.3 and today MySQL 5.1 BK sources.
[24 Aug 2006 8:32] Stephen Downs
I too have been plagued by this show stopping issue which is still a problem with MySQL 5.0.23.

My setup: newly configured PowerPC G4 OS X 10.4.7 box, gcc as provided with Xcode 2.3 (can't use 2.4 because of php bug), Apache 2 (httpd-2.2.3), MySQL 5.0.23 pre-compiled, php 5.1.5.

To replicate: Configure and install Apache and MySQL, then try php. The following two php configure directives included together will cause the crypto conflict previously outlined: --with-mysql --with-curl.

If the configure --with-curl directive is left out, then php will successfully make. I also followed the basic instructions outlined here http://www.phpmac.com/articles.php?view=252 , which will generate the issue, unless either the --with-curl line or the --with-mysql line is removed.