1

几个小时以来,我一直在尝试使用几个 PEAR 包,但无济于事。PEAR 本身正在运行,我相信我正确设置了所有配置变量,但是当我尝试从命令行运行我的任何包时,我收到 PHP 错误,告诉我找不到所需的文件。例如,使用phpdoc

$ phpdoc
PHP Warning:  require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40

Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
PHP Fatal error:  require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40

Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40

我尝试手动编辑文件,插入文件的绝对路径,但是当我更正一个require错误时,就会出现一个新错误。

这是我的 pear.conf:

#PEAR_Config 0.9
a:15:{s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}s:15:"preferred_state";s:6:"stable";s:8:"temp_dir";s:35:"/Applications/MAMP/htdocs/pear/temp";s:7:"bin_dir";s:34:"/Applications/MAMP/htdocs/pear/bin";s:7:"php_dir";s:35:"/Applications/MAMP/htdocs/pear/PEAR";s:7:"doc_dir";s:40:"/Applications/MAMP/htdocs/pear/PEAR/docs";s:8:"data_dir";s:40:"/Applications/MAMP/htdocs/pear/PEAR/data";s:8:"test_dir";s:41:"/Applications/MAMP/htdocs/pear/PEAR/tests";s:9:"cache_dir";s:41:"/Applications/MAMP/htdocs/pear/PEAR/cache";s:9:"cache_ttl";i:300;s:12:"download_dir";s:44:"/Applications/MAMP/htdocs/pear/temp/download";s:10:"http_proxy";s:0:"";s:7:"ext_dir";s:74:"/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20050922";s:7:"php_bin";s:37:"/Applications/MAMP/bin/php5.2/bin/php";s:10:"sig_keydir";s:39:"/Applications/MAMP/conf/php5.2/pearkeys";}

梨配置

我在 Mac OS 10.7.5 上使用 MAMP PRO v1.9.5 和 PHP v5.2.17。此外,我使用 PEAR Web 界面包管理器安装了这些包。如果需要任何进一步的信息,请告诉我,我会发布。

4

1 回答 1

2

确保包含路径包含 PEAR 安装 php 类文件的文件夹。检查您的include_pathini设置。它应该看起来像:

include_path=".:PEAR_CLASSES_PATH"

PEAR_CLASSES_PATH梨类路径在哪里

于 2013-03-23T00:02:00.217 回答