2010-07-13 45 views
0

我试图使用PEAR的Text_Password类,但不知道如何包含它。如何在MAC中包含PEAR php包时更改include路径在.htaccess中

我已经安装了PEAR。我猜测它已经把类放在了PHP目录的某个地方。我有这个在我的.htaccess文件中

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

这就是为什么我猜测它没有选择它们。有谁知道我可以包括PEAR课程?

以下是错误messageI得到:

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 

我已经改变了我的.htaccess文件的原因是因为我使用了Zend框架。我把Zend类放在include文件夹中。我可以为PEAR做类似的事吗?

非常感谢!

Jonesy

回答

2

您可以设置多个文件夹,请参阅:http://php.net/manual/en/function.set-include-path.php

例2种将可能最适合您的需求。你也可以在你的php ini文件中做到这一点。

+0

感谢您的信息。我尝试加入 $ path ='/ usr/lib/php/PEAR'; set_include_path(get_include_path()。PATH_SEPARATOR。$ path); 但仍似乎不工作:(我不知道如果你知道很多关于梨库,但我想使用Text_Password。我已更新我的代码,以显示我得到的错误消息。 – iamjonesy 2010-07-13 14:33:55

+0

Got它的工作原理是缺少PEAR的Text/Password.php文件,只是随着新的包含文件一起创建它,它的工作原理 - 欢呼阿什利 – iamjonesy 2010-07-13 15:06:56