2

I'm having trouble installing PHP's PDO_MySQL extension on a Mac OS X 10.5.8 server. The problem comes from configuration.

I have tried taking the steps outlined in this answer but can only get so far as the command $ ./configure --with-pdo-mysql=/usr/local/mysql. When I run this, I get the following error:

configure: error: Try adding --with-zlib-dir=. Please check config.log for more information.

I don't know what this means, and I can't seem to find much information on the Internet about it, other than "zlib for Mac OS X: zlib is already included as part of Mac OS X" -- which to me means I don't have to install anything new.

However, I don't know where the zlib directory is that I should be putting here. Does anyone know where I would find this directory?

Edit

Pastebin of config.log

Update 2

After including /usr as the zlib-dir, I am getting the following error:

checking for mysql_query in -lmysqlclient... no
checking for mysql_query in -lmysqlclient... (cached) no
configure: error: PDO_MYSQL configure failed. Please check config.log for more information.

This was a little more dramatic in a different version (1.0.2):

checking for mysql_query in -lmysqlclient... no
configure: error: mysql_query missing!?

I've included the config.log in a new Pastebin.

Community
  • 1
  • 1
Ian Hunter
  • 9,466
  • 12
  • 61
  • 77
  • So what's in config.log? – Mark Adler Mar 14 '12 at 18:51
  • @MarkAdler I've updated my question to give that information. – Ian Hunter Mar 14 '12 at 19:02
  • What do you get from these commands?
    ls /usr/lib/libz*
    ls /usr/include/z*
    – Mark Adler Mar 14 '12 at 19:29
  • `$ls /usr/lib/libz*` /usr/lib/libz.1.1.3.dylib /usr/lib/libz.1.2.3.dylib /usr/lib/libz.1.dylib /usr/lib/libz.dylib /usr/lib/libzfs.dylib `$ls /usr/include/z*` /usr/include/zconf.h /usr/include/zlib.h – Ian Hunter Mar 14 '12 at 19:37
  • Ian, did you ever find a solution for this? I'm running into what I think is the exact same issue: Mac OS X Server 10.5.8, trying to install pdo_mysql as a dynamic extension. – Stephen Washburn Jan 28 '14 at 06:43
  • @StephenWashburn — Oh boy, it's been a while. I don't think I did. Looking at the code I wrote for this, I have two methods. It prefers PDO, but `if(!extension_loaded('pdo_mysql'))` I run a mysqli method. Not the most glamorous, but it abstracted things for when I could migrate things to a working server. – Ian Hunter Jan 29 '14 at 02:45
  • @IanHunter no problem, thanks for responding! I finally gave up and began the process of migrating to a newer server. I WAS running on an Xserve G5, the new machine is a mac mini which makes me a **little** uncomfortable even though I know they've been used as servers VERY effectively. But 16 GB of ram and a modern version of Apache and PHP makes it worth it. – Stephen Washburn Jan 30 '14 at 03:22

1 Answers1

0

It looks like zlib is already where it's supposed to be. I don't know why configure isn't finding it. The config.log does not provide enough information about how it tried to look for libz and failed.

I suppose you could try --with-zlib-dir=/usr, but that seems a little silly, since that's where it should be looking anyway.

Mark Adler
  • 101,978
  • 13
  • 118
  • 158