I installed Pear with the following command:
sudo apt-get install php-pear
Now Pear list
gives the following output:
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Console_Getopt 1.3.0 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
Next I installed MDB2 with the following command: pear install MDB2
downloading MDB2-2.4.1.tgz ...
Starting to download MDB2-2.4.1.tgz (119,790 bytes)
..........................done: 119,790 bytes
install ok: channel://pear.php.net/MDB2-2.4.1
MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)
MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)
MDB2: Optional feature mysql available (MySQL driver for MDB2)
MDB2: Optional feature mysqli available (MySQLi driver for MDB2)
MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)
MDB2: Optional feature oci8 available (Oracle driver for MDB2)
MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)
MDB2: Optional feature querysim available (Querysim driver for MDB2)
MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)
MDB2: To install optional features use "pear install pear/MDB2#featurename"
Then I included MDB2.php in one of my program using require_once('MDB2.php')
, but I got these errors during runtime:
Warning: require_once(MDB2.php) [function.require-once]: failed to open stream: No such file or directory in /opt/lampp/htdocs/xampp/php/php_crash/phptomysql/connect.php on line 80
Fatal error: require_once() [function.require]: Failed opening required 'MDB2.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/xampp/php/php_crash/phptomysql/connect.php on line 80
It is clearly indicating that MDB2.php is missin
g. I have not included any file name MDB2.php
in my current directory. I am assuming it is some sort of global available anywhere.
How to solve this? I also tried this: sudo pear install MDB2_Driver_$mysql
I got his message for the above command:
No releases available for package "pear.php.net/MDB2_Driver_"
install failed
You need to setup the include_path properly. See the documentation.