By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,200 Members | 1,612 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,200 IT Pros & Developers. It's quick & easy.

php5 PEAR error on test scripts

P: 1
This is being installed on WindowsXP home edition.

I am a complete novice at working with php and have just installed apache2_2, php5, mySQL5.0 and phpMyAdmin 2.10.1. After installing all 4 programs following the instructions from it tells you to create a file called testpear.php to test your pear install when working with MySQL and PHP. The file I was to create contains this information:

require_once 'DB.php';

$db_host = 'localhost';
$db_user = 'root';
$db_pass = 'isnot14me';
$db_name = 'dataBase_name';
$dsn = "mysql://$db_user;$db_pass@unix+$db_host/$db_name";
$db = DB::connect($dsn);

When I bring it up in a browser these are the errors that I get:
Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\webs\test\testpear.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;C:\php\PEAR') in C:\webs\test\testpear.php on line 3

Being a novice at this I have no idea what this means and the only real answer I found was in a language I could not understand. Could you please help me out. Normally I would not ask for help but I am on a deadline for a school project and really need to figure this out. Everything else appears to be fine installation and test-wise with the exception of this test.

Any help you could provide would be appreciated.
Jun 5 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 1,351
what "require_once" does is open a file and places that whole files into the file that is calling it, this is useful when more than one page performs the same task as another page.

so, in your code u are telling your php script to open another script called DB.php, since u haven't made one it is complaning.
Jun 5 '07 #2

Expert 2.5K+
P: 3,237
Is DB.php in the C:\php\PEAR folder? If not then this is your problem.
Jun 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.