Forum Moderators: coopster

Message Too Old, No Replies

PEAR DB question

         

sphiro

7:48 pm on Mar 12, 2005 (gmt 0)

10+ Year Member



I have been trying to follow along with a tutorial on creating a PHP login script, which uses PEAR DB classes. However, once everything is set up and I atempt to run any of the .php files I get the following error:

Warning: main(PEAR.php): failed to open stream: No such file or directory in c:\php4\pear\DB.php on line 30

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.;c:\php4\pear') in c:\php4\pear\DB.php on line 30

This is the tutorial link: [free2code.net...]

Does anyone have any idea or any suggestions on how to correct this and what the problem may be?

Any input is greatly appriciated.

badone

11:52 pm on Mar 12, 2005 (gmt 0)

10+ Year Member



Does c:\php4\pear exist? Is there a PEAR.php file in it?

HTH,
BAD

sphiro

7:05 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Yes, the directory exists.
I found the problem and it was that the .zip file did not contain PEAR.php, so I downloaded separately.

However, I have another problem now:

Fatal error: Call to undefined function: loadextension() in c:\php4\pear\DB\mysql.php on line 195

How can this be corrected?

jatar_k

10:07 pm on Mar 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



sounds like a file isn't included or does not exist.

you need to find out where that function actually lives and make sure the script has access to it somehow.

sphiro

10:36 pm on Mar 14, 2005 (gmt 0)

10+ Year Member



Possibly altering 'php.ini' and adding an 'include_path' for the directory?

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

This is what I see in php.ini, would the addition of such a path be:
;include_path = ".;c:\php4\pear"?

Also would I need to remove the ';' to 'uncomment' it?

jatar_k

11:01 pm on Mar 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that could be it

try uncommenting it (yes, removing the ; ) and see if that helps