Getting Started
This section explains how to install the improved MySQL library and the basics of migrating existing code to the new functions.
Installing the Library
This section discusses installation on only Unix platforms. We assume you have followed our installation instructions in Appendix A through Appendix C, and that you have installed MySQL 4.1, PHP, and Apache and now want to enable the new library. We also assume that you've kept the source code for the components, and stored it in the subdirectories of /usr/local/src/ that are recommended in Appendix A through Appendix C.
To configure the improved MySQL library, you need to reconfigure, recompile, and reinstall PHP. You also need to restart your Apache 2 server. To do this, follow these steps:
Log in as the Unix root user.
Change directory to your PHP source directory location using:
%
cd /usr/local/src/php-version_numberFor example, if the version is PHP 5.0.0, type:
%
cd /usr/local/src/php-5.0.0Configure the PHP installation by running the
configurescript. Add improved MySQL support and disable regular MySQL support. This step assumes that MySQL 4.1 has been installed previously in the directory /usr/local/mysql and that Apache 2 has been installed in /usr/local/apache2:%
./configure --with-apxs2=/usr/local/apache2/bin/apxs \--without-mysql --with-mysqli=/usr/local/mysql/bin/mysql_configIf your configure script complains, then try removing mysql_config from the second line:
%
./configure --with-apxs2=/usr/local/apache2/bin/apxs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access