How do I figure out which ./configure options to use when building PHP 5.3.0 on Mac OS X? There are 10 zillion options and I have no idea which ones to use.
All I want is to make sure that I have PDO and PDO+MySQL enabled.
[[[[scream!]]]] I ran sudo port install php5-mysql
and it "worked", but when I run php:
$ php
PHP Warning: Cannot load module 'mysql' because required module 'mysqlnd' is not loaded in Unknown on line 0
Warning: Cannot load module 'mysql' because required module 'mysqlnd' is not loaded in Unknown on line 0
dyld: lazy symbol binding failed: Symbol not found: __mysqlnd_palloc_rinit
Referenced from: /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mysqli.so
Expected in: dynamic lookup
dyld: Symbol not found: __mysqlnd_palloc_rinit
Referenced from: /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mysqli.so
Expected in: dynamic lookup
Trace/BPT trap
aha! The maintainer of macports found the same problem. I did sudo port selfupdate
and reran the install of php5 and it worked fine.
Use MacPorts as they have packaged together most of the settings in a way much easier to understand. For example:
Enable the options you want by specifying them on the configure command line. The MySQL options that appear in my 5.1.6 configure command are as follows:
At a minimum, I would specify an install prefix along with the type (v1 or v2) of Apache install (which you should have already built) you have:
Ensure that mysql_config (assuming there is such a thing) is in your path, or tell configure where the mysql libraries are located.
If you want some really generic advice for building packages when you need to know how to configure something.
For PHP 5.3, integrating MySQL access libraries is really easy. It's just a matter of enabling the MySQL Native Driver (or
mysqlnd
) in the configure flags:For what it's worth, take a look at buildphp, which is a Rake-based build system for PHP that was made specifically to make compiling PHP 5.3 (and an up-to-date set of libraries for PHP extensions) easy.
http://github.com/patcoll/buildphp