/    Sign up×
Community /Pin to ProfileBookmark

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:

[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’);

?>[/CODE]

Any help would be very apreciatet

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NightShift58Feb 12.2007 — I think you need to tell PHP where PEAR can be found.

Use [b]set_include_path()[/b] to extend the system path.
Copy linkTweet thisAlerts:
@JJohnsenDKauthorFeb 12.2007 — i tried that but what should the path be?

Structure is like this:

webserver/php/pear/DB.php

and 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?
Copy linkTweet thisAlerts:
@NightShift58Feb 12.2007 — You can go as far back as "/" - if the system will let you.

The "webserver/htdocs" directory is your HTTP document root, so no URL can be referenced higher than that but includes are different.

Try it...
×

Success!

Help @JJohnsenDK spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...