I'm trying to run a script that makes use of Pear. You may see the code from the screen shot attached. I have a problem with my Pear configuration. When I run the script via Apache I get: Fatal error: Class 'DB' not found in C:\Program Files[. Are there any Pear experts out there?? Ive had a look at the http://pear.php.net/ manual but am finding it inpenetrable.
Assuming that the correct DB.php file is loaded by your require statement, that error message does not make much sense. You might want to try requiring it via its full path name in case another file in the include_path is being loaded instead.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Assuming that the correct DB.php file is loaded by your require statement, that error message does not make much sense. You might want to try requiring it via its full path name in case another file in the include_path is being loaded instead.
hi NogDog
The DB.php is in the same directory as the script?. My php.ini includes path is attached in a screenshot; is this ok?.
The error is telling you that no class named "DB" has been defined when you try to use it. Presumably it should have been defined by that require statement, so at this point I really don't know why that should be based on the evidence provided so far.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
The error is telling you that no class named "DB" has been defined when you try to use it. Presumably it should have been defined by that require statement, so at this point I really don't know why that should be based on the evidence provided so far.
looks like that's my 'Pear' experience cut short then..
Probably there's some "silly" error here that I'm just not seeing in the supplied code. You might want to try something really basic to see if anything obvious jumps out:
It should display something like the following if it works:
Code:
DB Object
(
)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Probably there's some "silly" error here that I'm just not seeing in the supplied code. You might want to try something really basic to see if anything obvious jumps out:
Try changing the require statement to the following, just in case it's an include_path issue:
PHP Code:
require_once "./DB.php";
(This assumes that as you mentioned above, the desired DB.php file is in the same directory as your test script.)
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Only other thing I can think of is that there's something wrong with the DB.php file itself. I did a local install of the PEAR DB package on my PC and the same test script runs fine.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Only other thing I can think of is that there's something wrong with the DB.php file itself. I did a local install of the PEAR DB package on my PC and the same test script runs fine.
That is definitely not the PEAR DB script. The version I have is about 1490 lines long.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks