JJohnsenDK Posted February 12, 2007 Share Posted February 12, 2007 Hey Im not sure how to link to pear. I get this error: Warning: main(DB.php): failed to open stream: No such file or directory in /usr/home/tallet4/public_html/test/db_connect.php on line 5 Fatal error: main(): Failed opening required 'DB.php' (include_path='.:') in /usr/home/tallet4/public_html/test/db_connect.php on line 5 And im using this code: <?php require_once 'DB.php'; $db_engine = 'mysql'; $db_user = 'user'; $db_pass = 'pass'; $db_host = 'localhost'; $db_name = 'name'; $datasource = $db_engine.'://'. $db_user.':'. $db_pass.'@'. $db_host.'/'. $db_name; $db_object = DB::connect($datasource, TRUE); if(DB::isError($db_object)) { die($db_object->getMessage()); } $db_object->setFetchMode(DB_FETCHMODE_ASSOC); include('check_login.php'); ?> Any help would be very apreciatet Link to comment https://forums.phpfreaks.com/topic/38155-pear-help/ Share on other sites More sharing options...
JJohnsenDK Posted February 12, 2007 Author Share Posted February 12, 2007 Anyone who can help me out here? Link to comment https://forums.phpfreaks.com/topic/38155-pear-help/#findComment-182650 Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 It looks to me like you don't have a file called "DB.php" in the same directory as the file you're trying to run. Link to comment https://forums.phpfreaks.com/topic/38155-pear-help/#findComment-182652 Share on other sites More sharing options...
JJohnsenDK Posted February 12, 2007 Author Share Posted February 12, 2007 yup i know but how do i tell that the file DB.php is in this folder: webserver/php/pear/DB.php When my htdocs is like this: webserver/htdocs/ how should i link to DB.php in pear folder? I cant go futher back than htdocs can i? I tried: set_include_path('../../php/pear/'); But its not working. Link to comment https://forums.phpfreaks.com/topic/38155-pear-help/#findComment-182658 Share on other sites More sharing options...
Balmung-San Posted February 12, 2007 Share Posted February 12, 2007 I'm not too familiar with how PEAR works, but I believe it's designed so that you can just drop the file into your directory and use it. That is, you should be fine by moving it into the same directory as this file. Link to comment https://forums.phpfreaks.com/topic/38155-pear-help/#findComment-182662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.