include-prefix/mysqldirectly but instead installs under the
include-prefixdirectory itself. So, when the PHP build system looks for the MySQL headers, it cannot find
<mysql/psi/mysql_thread.h>and so forth.
What is the fix?
The MySQL dev team has committed patches to fix this issue in MySQL which is due to go out in the next release. If you are impatient for the next release, go ahead and grab the patches and apply them onto the MySQL (5.5.8) source tree and recompile MySQL. You need to download the patch 1 first and apply it, followed by patch 2. The following are the basic steps to be followed:
- If MySQL server is running, bring it down.
shell$ sudo /path/to/mysql/bin/mysqladmin -u root shutdown
- Extract the source tarball (5.5.8) and apply the patches
- Configure and build the system.
- MySQL 5.5 and above uses CMake instead of the traditional autotools.
shell$ cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_unicode_ci -LH .
shell$ sudo make install
- Start the MySQL server.
shell$ sudo /path/to/mysql/bin/mysqld_safe --user=mysql &
Now that we have MySQL "fixed", we can configure PHP with the traditional
configure --with-mysqli=/path/to/mysql/bin/mysql_c followed by
make && sudo make install and you're good to go!