我使用以下命令安装了 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"
然后我将 MDB2.php 包含在我的一个程序中require_once('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