Archived: php_mysql.dll - Configuring PHP to Use MySQL Extension

This section describes how to configure PHP load MySQL extension, php_mysql.dll, to use MySQL functions.

If you want to access MySQL database servers from PHP scripts, you need to use MySQL functions provided by the MySQL Extension, php_mysql.dll. This tutorial shows you how to load and configure php_mbstring.dll.

1. Check the PHP configuration file, \local\php\php.ini. If not exist, make a copy from \local\php\php.ini-dist, or \local\php\php.ini-production:

C:\herong> copy \local\php\php.ini-dist \local\php\php.ini

C:\herong> rem or:
C:\herong> copy \local\php\php.ini-dist \local\php\php.ini-production

2. Open \local\php\php.ini in a text editor, like notepad.

3. Change the setting to allow PHP to load php_mysql.dll from the \local\php\ext directory:

...
;extension_dir = "./"
extension_dir = "./ext"
...
;extension=php_mysql.dll
extension=php_mysql.dll
...

The following settings in php.ini file are used by MySQL extension. You can take the default values:

mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

Last update: 2015.

Table of Contents

 About This Book

 PHP Installation on Windows Systems

 Integrating PHP with Apache Web Server

 charset="*" - Encodings on Chinese Web Pages

 Chinese Characters in PHP String Literals

 Multibyte String Functions in UTF-8 Encoding

 Input Text Data from Web Forms

 Input Chinese Text Data from Web Forms

 MySQL - Installation on Windows

 MySQL - Connecting PHP to Database

 MySQL - Character Set and Encoding

 MySQL - Sending Non-ASCII Text to MySQL

 Retrieving Chinese Text from Database to Web Pages

 Input Chinese Text Data to MySQL Database

Archived Tutorials

 Archived: Download and Install PHP 5.2.2 on Windows

 Archived: Downloading Apache 2.2.4 Binary for Windows

 Archived: Installing Apache 2.2.4 on Windows Systems

 Archived: MySQL 5.0 Download, Installation and Start

Archived: php_mysql.dll - Configuring PHP to Use MySQL Extension

 Archived: Commonly Used php_mysql.dll Functions

 Archived: mysql_connect() - Creating MySQL Connections

 Archived: Character Set Variables on MySQL 5

 Archived: Non-ASCII Test Analysis on MySQL 5

 Archived: Fetching Non-ASCII Text from MySQL 5

 Archived: Sending Text in Latin1 Encoding to MySQL 5

 Archived: Sending Text in UTF8 Encoding to MySQL

 References

 Full Version in PDF/EPUB