2010-07-13 43 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