我使用以下命令安装了Pear:
sudo apt-get install php-pear
现在Pear list
提供以下输出:
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
接下来,我使用以下命令安装了MDB2: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"
然后我使用require_once('MDB2.php')
将MDB2.php包含在我的一个程序中,但是我在运行时遇到了这些错误:
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
清楚地表明MDB2.php is missin
g。我没有在当前目录中包含任何文件名MDB2.php
。我假设它在任何地方都是可用的。
如何解决这个问题?我也试过这个:sudo pear install MDB2_Driver_$mysql
我收到了上述命令的消息:
No releases available for package "pear.php.net/MDB2_Driver_"
install failed