This entry was posted on Monday, March 19th, 2007 at 11:22 am and is filed under Errors Help. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
php-developers.net
php and mysql web development services
Fatal error: Class ‘MDB2′ not found
SOLUTION
1) Make sure that PEAR is listed in the include_path in php.ini. To include dynamically the pear package use the following code substituting ‘pear_location’ with the actual location of your PEAR installation.
set_include_path(get_include_path() . PATH_SEPARATOR . ‘pear_location’);
2) Make sure that you have INSTALLED MDB2 and the driver for the database you are going to use. For example if you are working with MySQL then you need the MDB2_driver_mysql.
2.1.) To get information about all PEAR packages use the following command:
pear list
2.2.) To install a package use:
pear install packageName
2.3.) To upgrade a package use:
pear upgrade packageName
2.4.) Make sure that the dependence packages are upgraded also. To view the information about the package and its dependancies use:
pear info packageName
3) If you are developing under Windows make sure that the file name of your application is not called mdb2.php since it would be mixed up with the PEAR/MDB2.php file.