|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am attempting to use createTables.php but I can't resolve the error "unable to find package 'MDB2_Driver_mysqli". I am using php 5, mysqli, MDB2 (btw: I don't have problems with this same combination on other php pages.) I turned up debug levels to 5 and here is what I get:
DB_DataObject_Generator : 0 : CREATING FOR 0 DB_DataObject_Generator : CONNECT : NEW CONNECTION DB_DataObject_Generator : CONNECT : mysqli:/root:mypwd@localhost/practice_stat 831cf97cd08f9b7f72544ea6833803ce DB_DataObject_Generator : CONNECT : a:1:{s:32:"831cf97cd08f9b7f72544ea6833803ce";O:10:"MDB2_Error":8:{s:20:"error_message_prefix";s:0:"";s:4:"mode";i:1;s:5:"level";i:1024;s:4:"code";i:-4;s:7:"message";s:21:"MDB2 Error: not found";s:8:"userinfo";s:153:"unable to find package 'MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat' file 'MDB2\Driver\mysqli:/root:mypwd@localhost/practice\stat.php'";s:9:"backtrace";a:10:{i:0;a:6:{s:4:"file";s:20:"C:\PHP\PEAR\MDB2.php";s:4:"line";i:973;s:8:"function";s:10:"PEAR_Error";s:5:"class";s:10:"PEAR_Error";s:4:"type";s:2:"->";s:4:"args";a:5:{i:0;s:21:"MDB2 Error: not found";i:1;i:-4;i:2;i:1;i:3;i:1024;i:4;s:153:"unable to find package 'MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat' file 'MDB2\Driver\mysqli:/root:mypwd@localhost/practice\stat.php'";}}i:1;a:7:{s:4:"file";s:20:"C:\PHP\PEAR\PEAR.php";s:4:"line";i:574;s:8:"function";s:10:"MDB2_Error";s:5:"class";s:10:"MDB2_Error";s:6:"object";r:2;s:4:"type";s:2:"->";s:4:"args";a:4:{i:0;i:-4;i:1;i:1;i:2;i:1024;i:3;s:153:"unable to find package 'MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat' file 'MDB2\Driver\mysqli:/root:mypwd@localhost/practice\stat.php'";}}i:2;a:7:{s:4:"file";s:20:"C:\PHP\PEAR\MDB2.php";s:4:"line";i:574;s:8:"function";s:10:"raiseError";s:5:"class";s:4:"PEAR";s:6:"object";O:23:"DB_DataObject_Generator":19:{s:6:"tables";N;s:12:"_definitions";N;s:5:"table";N;s:10:"_newConfig";N;s:8:"_extends";s:13:"DB_DataObject";s:12:"_extendsFile";s:17:"DB/DataObject.php";s:10:"_className";N;s:22:"_DB_DataObject_version";s:5:"1.8.8";s:7:"__table";s:0:"";s:1:"N";i:0;s:13:"_database_dsn";s:46:"mysqli:/root:mypwd@localhost/practice_stat";s:17:"_database_dsn_md5";s:32:"831cf97cd08f9b7f72544ea6833803ce";s:9:"_database";i:0;s:6:"_query";a:7:{s:9:"condition";s:0:"";s:8:"group_by";s:0:"";s:8:"order_by";s:0:"";s:6:"having";s:0:"";s:11:"limit_start";s:0:"";s:11:"limit_count";s:0:"";s:11:"data_select";s:1:"*";}s:12:"_DB_resultid";N;s:13:"_resultFields";b:0;s:12:"_link_loaded";b:0;s:5:"_join";s:0:"";s:10:"_lastError";b:0;}s:4:"type";s:2:"->";s:4:"args";a:7:{i:0;N;i:1;i:-4;i:2;N;i:3;N;i:4;s:153:"unable to find package 'MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat' file 'MDB2\Driver\mysqli:/root:mypwd@localhost/practice\stat.php'";i:5;s:10:"MDB2_Error";i:6;b:1;}}i:3;a:7:{s:4:"file";s:20:"C:\PHP\PEAR\MDB2.php";s:4:"line";i:340;s:8:"function";s:10:"raiseError";s:5:"class";s:4:"MDB2";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:4:{i:0;i:-4;i:1;N;i:2;N;i:3;s:153:"unable to find package 'MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat' file 'MDB2\Driver\mysqli:/root:mypwd@localhost/practice\stat.php'";}}i:4;a:7:{s:4:"file";s:20:"C:\PHP\PEAR\MDB2.php";s:4:"line";i:385;s:8:"function";s:9:"loadClass";s:5:"class";s:4:"MDB2";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;s:58:"MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat";i:1;b:0;}}i:5;a:7:{s:4:"file";s:20:"C:\PHP\PEAR\MDB2.php";s:4:"line";i:433;s:8:"function";s:7:"factory";s:5:"class";s:4:"MDB2";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;s:46:"mysqli:/root:mypwd@localhost/practice_stat";i:1;a:1:{s:11:"portability";i:126;}}}i:6;a:7:{s:4:"file";s:29:"C:\PHP\PEAR\DB\DataObject.php";s:4:"line";i:2252;s:8:"function";s:7:"connect";s:5:"class";s:4:"MDB2";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;s:46:"mysqli:/root:mypwd@localhost/practice_stat";i:1;a:1:{s:11:"portability";i:126;}}}i:7;a:7:{s:4:"file";s:39:"C:\PHP\PEAR\DB\DataObject\Generator.php";s:4:"line";i:175;s:8:"function";s:8:"_connect";s:5:"class";s:13:"DB_DataObject";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:8;a:7:{s:4:"file";s:39:"C:\PHP\PEAR\DB\DataObject\Generator.php";s:4:"line";i:144;s:8:"function";s:16:"_createTableList";s:5:"class";s:23:"DB_DataObject_Generator";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:9;a:7:{s:4:"file";s:42:"C:\PHP\PEAR\DB\DataObject\createTables.php";s:4:"line";i:58;s:8:"function";s:5:"start";s:5:"class";s:23:"DB_DataObject_Generator";s:6:"object";O:23:"DB_DataObject_Generator":19:{s:6:"tables";N;s:12:"_definitions";N;s:5:"table";N;s:10:"_newConfig";N;s:8:"_extends";s:13:"DB_DataObject";s:12:"_extendsFile";s:17:"DB/DataObject.php";s:10:"_className";N;s:22:"_DB_DataObject_version";s:5:"1.8.8";s:7:"__table";s:0:"";s:1:"N";i:0;s:13:"_database_dsn";s:0:"";s:17:"_database_dsn_md5";s:0:"";s:9:"_database";s:0:"";s:6:"_query";a:7:{s:9:"condition";s:0:"";s:8:"group_by";s:0:"";s:8:"order_by";s:0:"";s:6:"having";s:0:"";s:11:"limit_start";s:0:"";s:11:"limit_count";s:0:"";s:11:"data_select";s:1:"*";}s:12:"_DB_resultid";N;s:13:"_resultFields";b:0;s:12:"_link_loaded";b:0;s:5:"_join";s:0:"";s:10:"_lastError";b:0;}s:4:"type";s:2:"->";s:4:"args";a:0:{}}}s:8:"callback";N;}} DB_DataObject_Generator : CONNECT FAILED : [mdb2_error: message="MDB2 Error: not found" code=-4 mode=return level=notice prefix="" info="unable to find package 'MDB2_Driver_mysqli:/root:mypwd@localhost/practice_stat' file 'MDB2\Driver\mysqli:/root:mypwd@localhost/practice\stat.php'"] DB_DataObject_Generator : ERROR : Connect failed, turn on debugging to 5 see why DB_DataObject Error: Connect failed, turn on debugging to 5 see why >pear list shows this: INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET: ========================================= PACKAGE VERSION STATE Archive_Tar 1.3.2 stable Console_Getopt 1.2.3 stable Console_Table 1.1.2 stable DB 1.7.13 stable DB_DataObject 1.8.8 stable DB_Table 1.5.5 stable Date 1.4.7 stable File 1.3.0 stable HTML_Common 1.2.4 stable HTML_QuickForm 3.2.10 stable HTML_Table 1.8.2 stable MDB2 2.4.1 stable MDB2_Driver_mysqli 1.4.1 stable Net_URL 1.0.15 stable Net_URL_Mapper 0.9.0 beta OLE 1.0.0RC1 beta PEAR 1.7.1 stable PHPUnit 1.3.2 stable PHP_Compat 1.5.0 stable Pager 2.4.7 stable Spreadsheet_Excel_Writer 0.9.1 beta Structures_DataGrid 0.9.0 beta Structures_DataGrid_DataSource_Array 0.1.4 beta Structures_DataGrid_DataSource_CSV 0.1.6 beta Structures_DataGrid_DataSource_DB 0.1.1 beta Structures_DataGrid_DataSource_DBQuery 0.1.11 beta Structures_DataGrid_DataSource_DBTable 0.1.7 beta Structures_DataGrid_DataSource_DataObject 0.2.1 beta Structures_DataGrid_DataSource_MDB2 0.1.11 beta Structures_DataGrid_DataSource_PDO 0.1.0 beta Structures_DataGrid_DataSource_RSS 0.1.1 beta Structures_DataGrid_DataSource_XML 0.2.0 beta Structures_DataGrid_Renderer_CSV 0.1.4 beta Structures_DataGrid_Renderer_Console 0.1.1 beta Structures_DataGrid_Renderer_HTMLSortForm 0.1.3 beta Structures_DataGrid_Renderer_HTMLTable 0.1.5 beta Structures_DataGrid_Renderer_Pager 0.1.3 beta Structures_DataGrid_Renderer_Smarty 0.1.4 beta Structures_DataGrid_Renderer_XLS 0.1.3 beta Structures_DataGrid_Renderer_XML 0.1.3 beta Structures_DataGrid_Renderer_XUL 0.1.3 beta Structures_Graph 1.0.2 stable XML_Parser 1.2.8 stable XML_RSS 0.9.10 beta XML_Serializer 0.18.0 beta XML_Util 1.2.0 stable I have a feeling I'm missing a pear package, but I don't know which one. Can anyone help? Also, if anyone can point me to some instructions for deciphering the debug output I would really appreciate it. Thanks, Roxanne |
|
#2
|
|||
|
|||
|
The missing package that the error message indicates seems to be installed. Maybe an include_path issue? Did you install the mentioned packages via the PEAR installier, without modifying the directory structure after the installation?
|
|
#3
|
|||
|
|||
|
Yes, I did install the pear packages with the installer. No, I didn't make any directory changes. You may be right about the include path issue.
from c:\WINDOWS\php.ini: ;***** Added by go-pear include_path="C:\php\PEAR\pear;c:\php\pear" ;**** from the directory c:\PHP\PEAR\DB\DataObject I type the command: >php createTables.php c:\dataobjects\practice_stat.ini contents of practice_stat.ini: [DB_DataObject] database = mysqli:/root:****@localhost/practice_stat schema_location = /dataobjects/schema/ class_location = /dataobjects/ require_prefix = /dataobjects/ class_prefix = DataObjects_ extends_location = DB/DataObject.php extends = DB_DataObject db_driver = MDB2 debug = 5 WINDOWS Environment Variable "Path" contains: C:\php\;c:\php\PEAR\; Did I cover all the bases for include paths? |
|
#4
|
|||
|
|||
|
The include_path is usually configured in php.ini. It is likely that you have two files of this name on your system, one for the webserver's PHP, and one for the CLI version of PHP. The latter one is used if you run "php ..." on the command line. Both of these files need to have the right include_path. I guess that the PEAR installer has modified only of these files.
|
|
#5
|
|||
|
|||
|
I did have more than one php.ini and messed around with my system's configuration so that I only need one. That didn't fix the problem though. What did solve the problem was fixing a typo in my [DB_DataObject] options. The connect string, mysqli:/root:****@localhost/practice_stat, was missing a "/". It should be - mysqli://root:****@localhost/practice_stat . It is one of those dumb errors that you kick yourself for, but I thought I would post it in case it could trigger the lightbulb for someone else. Thanks for your help, wiesemann.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > MDB2 error with createTables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|