Re: [PHP] Re: intalling pear:db

2004-12-04 Thread [EMAIL PROTECTED]
Ryan, 

Your suggestion led me to the solution.  I was having the same problem with
php returning a fatal error made me think DB.php was to blame.  But it ended
up being an include problem after all...

I use php 4.3.8 and my include path to the PEAR libraries was already set.
The actual problem was including my config file which defined my DSN driver.
Once I was able to successfully include the config file and actually define
the DSN info, everything was fine.

Thanks!
Tim


on 11/26/04 1:18, Ryan King at [EMAIL PROTECTED] wrote:

 
 On Nov 25, 2004, at 1:56 AM, Merlin wrote:
 
 Hi,
 
 that did not help. The pear manual says that this can be installed via
 command line, plus pear list tells me that the package is installed.
 However if I call phpinfo() there is no mentioning about pear in any
 way?! Do I have to enable it first anyhow?`
 
 
 How about trying a var_dump() on your DB object? For me, this is always
 the first step in trying to solve a mystery like this. Chances are,
 your DB object is really a PEAR_Error object because your failed to
 connect to your database.
 
 -ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: intalling pear:db

2004-11-25 Thread Jason Wong
On Thursday 25 November 2004 15:56, Merlin wrote:

  I successfully upgraded with this command. However the system still
  says: Fatal error: Call to undefined function: fetchrow()

The error message will say which line caused the error. Examine that line and 
see how fetchrow() is being called. Is it called as part of an object's 
method? Is that object one of pear's?

 that did not help. The pear manual says that this can be installed via
 command line, plus pear list tells me that the package is installed.
 However if I call phpinfo() there is no mentioning about pear in any way?!
 Do I have to enable it first anyhow?`

If you have full error reporting enabled, then any errors in including the 
pear files will show. All the pear stuff are just files that you include. 
There is no setting as such to enable to disable pear.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
True leadership is the art of changing a group from what it is to what
it ought to be.
-- Virginia Allan
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: intalling pear:db

2004-11-25 Thread Merlin
Hi Jason,
All the pear stuff are just files that you include.
I do not understand?! How come the pear site provides a command line installer:
http://pear.php.net/manual/en/installation.cli.php
When I call pear list it tells me that pear:db is installed. I also tried to 
compile php '--with-PEAR', but it tells me nowhere in the phpinfo() that there 
is anything about pear.

So you say I have to copy the untared pear:db files to any directory and include 
them?

Thanx,
Merlin

Jason Wong wrote:
On Thursday 25 November 2004 15:56, Merlin wrote:

I successfully upgraded with this command. However the system still
says: Fatal error: Call to undefined function: fetchrow()

The error message will say which line caused the error. Examine that line and 
see how fetchrow() is being called. Is it called as part of an object's 
method? Is that object one of pear's?


that did not help. The pear manual says that this can be installed via
command line, plus pear list tells me that the package is installed.
However if I call phpinfo() there is no mentioning about pear in any way?!
Do I have to enable it first anyhow?`

If you have full error reporting enabled, then any errors in including the 
pear files will show. All the pear stuff are just files that you include. 
There is no setting as such to enable to disable pear.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: intalling pear:db

2004-11-25 Thread Greg Beaver
Merlin wrote:
that did not help. The pear manual says that this can be installed via
command line, plus pear list tells me that the package is installed.
However if I call phpinfo() there is no mentioning about pear in any 
way?!
Do I have to enable it first anyhow?`
I assume you have very little PHP experience, so I'll try not to skip 
any steps.

Forget pear for now.
in PHP, if you have this file:
?php
include_once 'blah.php';
?
then php.exe (on windows) or /usr/bin/php (in unix - path may vary) will 
 read a special configuration variable called include_path that looks 
something like this:

.;C:\php4
in windows or
.:/usr/local/lib/php
in unix
PHP will pretend your script is:
?php
include_once './blah.php';
?
and if ./blah.php does not exist, it will try
?php
include_once '/usr/local/lib/php/blah.php';
?
See?  So, if blah.php is actually located in /usr/lib/php/blah.php, php 
will not find it and cause an error.  So, you have to change the 
include_path

?php
set_include_path('/usr/lib/php' . PATH_SEPARATOR . get_include_path());
include_once 'blah.php';
?
PEAR only installs files, it does not change include_path because this 
is impossible to do automatically.  What you need to do is find the 
location of DB.php, and make sure the absolute path that leads to DB.php 
is in your include_path (/usr/local/lib/php/DB.php, perhaps, or 
C:\php4\pear\DB.php)

Having said this, the error you are experiencing sounds like a bug in 
the code.  There are two possibilities

1) there is a file named DB.php located in the . directory, that is 
being included *before* pear's db would be included
2) there is an ancient version of DB.php that is being included before 
pear's DB.php

the get_included_files() function can help you lots on this one
http://us2.php.net/manual/en/function.get-included-files.php
Greg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: intalling pear:db

2004-11-25 Thread Ryan King
On Nov 25, 2004, at 1:56 AM, Merlin wrote:
Hi,
that did not help. The pear manual says that this can be installed via 
command line, plus pear list tells me that the package is installed. 
However if I call phpinfo() there is no mentioning about pear in any 
way?! Do I have to enable it first anyhow?`

How about trying a var_dump() on your DB object? For me, this is always 
the first step in trying to solve a mystery like this. Chances are, 
your DB object is really a PEAR_Error object because your failed to 
connect to your database.

-ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: intalling pear:db

2004-11-24 Thread Greg Beaver
Merlin wrote:
Hi there,
I am trying to get a class running which requires pear:DB.
I downloaded the package and executed:
# pear install DB-1.6.8.tgz
DB already installed
pear upgrade DB-1.6.8.tgz
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: intalling pear:db

2004-11-24 Thread Merlin
Greg Beaver wrote:
Merlin wrote:
Hi there,
I am trying to get a class running which requires pear:DB.
I downloaded the package and executed:
# pear install DB-1.6.8.tgz
DB already installed

pear upgrade DB-1.6.8.tgz
Hi,
I successfully upgraded with this command. However the system still says:
Fatal error: Call to undefined function: fetchrow()
Is fetchrow a part from pear:db? And if so, why does it still not work? I have 
restarted the webserver.

Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: intalling pear:db

2004-11-24 Thread Jeffery Fernandez
Merlin wrote:
Greg Beaver wrote:
Merlin wrote:
Hi there,
I am trying to get a class running which requires pear:DB.
I downloaded the package and executed:
# pear install DB-1.6.8.tgz
DB already installed

pear upgrade DB-1.6.8.tgz

Hi,
I successfully upgraded with this command. However the system still says:
Fatal error: Call to undefined function: fetchrow()
Is fetchrow a part from pear:db? And if so, why does it still not 
work? I have restarted the webserver.

Merlin
Make sure the pear libraries are within the include path of PHP. Open 
your php.ini and look for the include_path directive.  Read more here: 
http://au.php.net/manual/en/ini.sect.path-directory.php#ini.include-path

cheers,
Jeffery
http://melbourne.ug.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: intalling pear:db

2004-11-24 Thread Merlin
Jeffery Fernandez wrote:
Merlin wrote:
Greg Beaver wrote:
Merlin wrote:
Hi there,
I am trying to get a class running which requires pear:DB.
I downloaded the package and executed:
# pear install DB-1.6.8.tgz
DB already installed


pear upgrade DB-1.6.8.tgz

Hi,pear list

I successfully upgraded with this command. However the system still says:
Fatal error: Call to undefined function: fetchrow()
Is fetchrow a part from pear:db? And if so, why does it still not 
work? I have restarted the webserver.

Merlin
Make sure the pear libraries are within the include path of PHP. Open 
your php.ini and look for the include_path directive.  Read more here: 
http://au.php.net/manual/en/ini.sect.path-directory.php#ini.include-path

cheers,
Jeffery
http://melbourne.ug.php.net
Hi,
that did not help. The pear manual says that this can be installed via command 
line, plus pear list tells me that the package is installed. However if I call 
phpinfo() there is no mentioning about pear in any way?! Do I have to enable it 
first anyhow?`

Thanx, Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php