views:

18

answers:

1

Hi folks,

I'm trying to use the Text_Password class of PEAR but am not sure how to include it.

I have installed PEAR. And I'm guessing it has put the classes somewhere in the PHP directory. I have this in my .htaccess file

php_value include_path .:/Library/WebServer/Documents/phpweb20/include

Which is why I'm guessing it isn't picking them up. Does anyone know how i can include the PEAR classes?

Here is the error messageI get:

Warning: include_once(Text/Password.php) [function.include-once]: failed to open stream: No such file or directory in /Library/WebServer/Documents/phpweb20/include/Zend/Loader.php on line 146

Warning: include_once() [function.include]: Failed opening 'Text/Password.php' for inclusion (include_path='.:/Library/WebServer/Documents/phpweb20/include') in /Library/WebServer/Documents/phpweb20/include/Zend/Loader.php on line 146

Fatal error: Class 'Text_Password' not found in /Library/WebServer/Documents/phpweb20/include/DatabaseObject/User.php on line 25

The reason I have changed my .htaccess file is because I am using the Zend framework. I put the Zend classes in the include folder. Can I do something similar for PEAR?

Thanks a lot!

Jonesy

+2  A: 

You can set multiple folders, see: http://php.net/manual/en/function.set-include-path.php

Example 2 will probably best suit your needs. You can also do that in your php ini file.

Ashley
Thanks for the info. I tried adding $path = '/usr/lib/php/PEAR';set_include_path(get_include_path() . PATH_SEPARATOR . $path);But still doesn't seem to work :( I'm not sure if you know much about the PEAR libraries but I'm trying to use Text_Password. I've updated my code to show the error message I get.
iamjonesy
Got it working, was missing the Text/Password.php file from PEAR. Just created it myself along with the new include and it works - cheers Ashley
iamjonesy