问题
I've a problem with PEAR (PHP). This is the error:
Warning: require_once(DB.php): failed to open stream: No such file or directory in /WWW/xxx.php on line 2
Fatal error: require_once(): Failed opening required 'DB.php' (include_path='.:/usr/share/php:/usr/share/pear') in /WWW/xxx.php on line 2
I've already installed PEAR (version 1.9.0) In my PHP file the first two lines are these:
1- <?php
2- require_once('DB.php');
Where's the problem? Thank you all!
回答1:
You need to install the module:
pear install DB
Although this page gives a warning about this package being superseded (not deprecated) by MDB2.
回答2:
You can also install module without using pear:
With Fedora/CentOS:
- yum install php-pear-DB
With Debian/Ubuntu:
- apt-get install php-db
-- Dario
来源:https://stackoverflow.com/questions/8036603/php-pear-require-oncedb-php