Originally posted by berrance
for any body having trouble compling and building PHP with suport for both mysql and mysqli follow these steps
- untar the package as normal
- whan you run ./configure run both options --with-mysql=/pathto/mysql_config --with-mysqli=/pathto/mysql_config
run that and befor you build php by running the make command you first need to load the make file into your editor of choice and find the line that starts with EXTRA_LIBS on that line you should see -lmysqlclient twice. deleate the second accurance of it and save the file and then you can now run the make and make instsall commands [/B]
Perhaps this only affects your system (configure making bad Makefiles). I've never had to manually edit the Makefiles, and it's worked flawlessly every time.
Note that -with-mysql= is supposed to point to the root of the libraries (/usr for /usr/lib, /usr/local for /usr/local/lib, or the default: /usr/local/mysql for /usr/local/mysql/lib), but mysqli is supposed to be the full path to mysql_config. Maybe that's why you've been having problems. Basically whatever you specify for --with-mysql, should normally contain a subdirectory called lib/, that itself has a subdirectory named mysql/, and inside that last folder, resides libmysqlclient.*
For example, in my configure script, I use:
...
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mysql=/usr/local/mysql \
...
From ./configure --help:
--with-mysql[=DIR] Include MySQL support. DIR is the MySQL base directory.
...
--with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname
to mysql_config.