i install pear
but i faces problem
plz help me .
Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\peartest.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;c:\php\includes;C:\php\PEAR') in c:\Inetpub\wwwroot\peartest.php on line 3
pear problem
Moderator: General Moderators
-
prakashadmane
- Forum Commoner
- Posts: 33
- Joined: Thu Mar 01, 2007 1:53 am
- Location: mumbai,india
- Contact:
-
prakashadmane
- Forum Commoner
- Posts: 33
- Joined: Thu Mar 01, 2007 1:53 am
- Location: mumbai,india
- Contact:
PEAR is an extension for PHP. These days PEAR is included with PHP, but you need to install it yourself. I use PEAR on all my PHP developments.
Ok.. Installing PEAR isn’t bad, here is what you do:
Open a command line window (i.e. Start->Run->cmd)
Go to the PHP directory, in my case C:\php. Type go-pear.bat. Follow the instructions.
The PEAR extension get installed in C:\php\PEAR directory.
Once PEAR is installed, go to the php.ini file in your Apache2 directory. Find the
Code:
;include_path = ".;c:\php\includes"
Remove the semi-colon (to un-comment it), and then add C:\php\PEAR to it
Code:
include_path = ".;c:\php\includes;C:\php\PEAR"
i use this manual to pear install . plz help bi=ut till i face problem
Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\peartest.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;c:\php\includes;C:\php\PEAR') in c:\Inetpub\wwwroot\peartest.php on line 3
Ok.. Installing PEAR isn’t bad, here is what you do:
Open a command line window (i.e. Start->Run->cmd)
Go to the PHP directory, in my case C:\php. Type go-pear.bat. Follow the instructions.
The PEAR extension get installed in C:\php\PEAR directory.
Once PEAR is installed, go to the php.ini file in your Apache2 directory. Find the
Code:
;include_path = ".;c:\php\includes"
Remove the semi-colon (to un-comment it), and then add C:\php\PEAR to it
Code:
include_path = ".;c:\php\includes;C:\php\PEAR"
i use this manual to pear install . plz help bi=ut till i face problem
Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\peartest.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.;c:\php\includes;C:\php\PEAR') in c:\Inetpub\wwwroot\peartest.php on line 3
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
-
prakashadmane
- Forum Commoner
- Posts: 33
- Joined: Thu Mar 01, 2007 1:53 am
- Location: mumbai,india
- Contact:
the reason you're getting the error is because DB isn't installed yet even though pear is. On a linux box it's easy to install DB, however by the looks of your code above you're on a windows machine.
look at this page, it explains how to install DB on a windows machine. http://www.design-ireland.net/index.php ... 0000000041
look at this page, it explains how to install DB on a windows machine. http://www.design-ireland.net/index.php ... 0000000041
Re: pear problem
try this code to test your connection
replace USER, PASSWORD, localhost, DBNAME with your own details.
if not error, everthing is ok with your DB.php and pear, so it must be your code
Code: Select all
<?php
require_once( "DB.php" );
$dsn = 'mysql://USER:PASSWORD@localhost/DBNAME;
$db =& DB::Connect( $dsn, array() );
if (PEAR::isError($db)) { die($db->getMessage()); }
?>
if not error, everthing is ok with your DB.php and pear, so it must be your code