Re: PHP question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jonathan Hohle
Date:  
To: plug-discuss
Subject: Re: PHP question
on the 411.php page your admin gave you look for a field called
"include_path" it should have /usr/share/pear or some path to pear in
it, if it doesn't i'm guessing pear won't work as expected.

looking at one of the servers from the school i attended, it looks
like people have put pear in their personal web directories in
<personal web root>/lib/pear. <personal web root>/lib may or may not
be a directory apache/php includes in it's include path when it runs
by default (kind of like ~/bin in bash).

don't know any specifics about it, but I hope that helps.

Jon
<><


On Thu, 9 Sep 2004 11:19:31 -0400, Vaughn Treude <> wrote:
> Hello all:
> I'm a definite newbie to PHP. What I'm trying to do is to create a user
> database on my organization's web site. It's hosted by hostcentric.com. The
> first thing I did was to request that hostcentric create a mySQL database for
> me. Then I uploaded a sample PHP file from a login tutorial and tried to
> execute it. This is the PHP file:
>
> <?php
>
> //require the PEAR::DB classes.
>
> require_once 'DB.php';
>
> $db_engine = 'mysql';
> $db_user = 'XXXX';
> $db_pass = 'YYYYYYYY';
> $db_host = 'ieeepacn.com';
> $db_name = 'ZZZZZZZ';
>
> $datasource = $db_engine.'://'.
>                           $db_user.':'.
>                           $db_pass.'@'.
>                           $db_host.'/'.
>                           $db_name;

>
> $db_object = DB::connect($datasource, TRUE);
>
> /* assign database object in $db_object,
>
> if the connection fails $db_object will contain
>
> the error message. */
>
> // If $db_object contains an error:
>
> // error and exit.
>
> if(DB::isError($db_object)) {
>         die($db_object->getMessage());
> }

>
> $db_object->setFetchMode(DB_FETCHMODE_ASSOC);
>
> // we write this later on, ignore for now.
>
> //include('check_login.php');
>
> ?>
>
> And this is the result when I try to run db_connect.php:
>
> Warning: main(DB.php): failed to open stream: No such file or directory in
> /data/web/76076/www/test/db_connect.php on line 5
>
> Fatal error: main(): Failed opening required 'DB.php' (include_path='.') in /
> data/web/76076/www/test/db_connect.php on line 5
>
> The script uses the PEAR extensions for PHP-to-database connectivity. Since
> hostcentric's Unix servers support PHP I was hoping they also had the PEAR
> files installed. I called their tech support guy and he didn't know. He did
> direct me to a page called 411.php under my site's domain, which shows a
> "configure" box that includes an option called "--with-pear". This seems to
> indicate that they have PEAR, but where? From the error messages above I
> seem to have a bogus include path.
>
> Any suggestions from the PHP gurus out there? Do I need to upload all the
> PEAR support files, such as DB.php? Or is there a normal place where these
> are located? If so, how do I update the include path?
>
> Thanks!
>
> Vaughn Treude
> Nakota Software, Inc.
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>




--
Jon
<><
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss