Install PEAR MDB2 on an Apache 2 webserver
Information
Hosting providers do not allow you full access over the Apache configuration.
Usually you are only allowed to modify the .htaccess file. Furthermore you can not install any software.
This tutorial describes how to install the PEAR MDB2 packages manually, how to
modify the .htaccess file and how to use the MDB2 package.
The Apache 2 weberver is installed on Windows XP.
More information about PEAR can be found at:
http://pear.php.net
Operating system used
Windows XP Home Edition Version 5.1 SP 2
Software prerequisites
PHP 4
Apache 2.0 or higher
MySQL 3.23 or higher
Procedure
- Download the following PEAR packages:
- PEAR (PEAR-1.4.11.tgz)
- MDB2 (MDB2-2.2.1.tgz) : database abstraction layer
- MDB2_Driver_mysql (MDB2_Driver_mysql-1.2.1.tgz) : mysql MDB2 driver
- Create a directory outside the docroot, for example:
C:\mobilefish_web_lib
- Copy the files to C:\mobilefish_web_lib:
- Unpack PEAR-1.4.11.tgz into directory c:\temp1
- cd c:\temp1\PEAR-1.4.11
- xcopy /S * C:\mobilefish_web_lib
- Copy the files to C:\mobilefish_web_lib:
- Unpack MDB2-2.2.1.tgz into directory c:\temp2
- cd c:\temp2\MDB2-2.2.1
- xcopy /S * C:\mobilefish_web_lib
- Copy the files to C:\mobilefish_web_lib:
- Unpack MDB2_Driver_mysql-1.2.1.tgz into directory c:\temp3
- cd c:\temp3\MDB2_Driver_mysql-1.2.1
- xcopy /S * C:\mobilefish_web_lib
- Add the following line in the .htaccess file located in the docroot.
php_value include_path c:/mobilefish_web_lib;.
Note 1: Use the forward slash c:/
Note 2: If you add more paths separate with a semicolon <path>;<path>
- Create database "mobilefishdb" and table "address".
See quick guide: Create database and tables.
- Restart Apache.
|