在OSX上通过PEAR安装的PhpDocumentor无法正常工作-缺少文件? [英] PhpDocumentor installed via PEAR on OSX not working - missing files?

查看:125
本文介绍了在OSX上通过PEAR安装的PhpDocumentor无法正常工作-缺少文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是PEAR(和PhpDocumentor)的新手;我使用PEAR CLI安装了PhpDocumentor,一切似乎都很好……直到我开始使用它,这时出现了以下错误:

I'm basically new to PEAR (and PhpDocumentor); I installed PhpDocumentor using the PEAR CLI, and everything seemed to go fine... until I went to use it, at which point I got the following error:

Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): 
failed to open stream: No such file or directory in 
/usr/local/bin/phpdoc on line 40

Fatal error: require(): Failed opening required 
'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/usr/share/pear') 
in /usr/local/bin/phpdoc on line 40

我在网上找不到有关该错误的任何内容,因此我再次通过命令行进行了卸载/重新安装,而没有出现错误,但是我遇到了同样的问题.我忽略了什么吗?正如我所说的,我对PEAR还是很陌生:)

I couldn't find anything online about the error, so I uninstalled/reinstalled via the command line again without error, but I'm getting the same problem. Have I overlooked something? As I said I'm quite new to PEAR :)

谢谢. D

推荐答案

要弄清楚PEAR在哪里放置东西,请运行pear config-show.如果PEAR早先说过它已经为您成功安装了PhpDocumentor,那么您要查找的文件应该在php_dir设置的值中找到(在我的Mac上是/usr/lib/php/PEAR).

To figure out where PEAR is putting things, run pear config-show. If PEAR had said earlier that it had successfully installed PhpDocumentor for you, then the file you're looking for should be found in the php_dir setting's value (on my Mac, this is /usr/lib/php/PEAR).

必须在您的include_path中设置此php_dir值,以使大多数PEAR软件包正常运行.由于/usr/share/pear确实出现在您的include_path中,根据您在上面包含的错误,我不得不猜测您的PEAR安装将php_dir设置为其他位置.

It is necessary for this php_dir value to be set in your include_path for most PEAR packages to function properly. Since /usr/share/pear DOES appear to be in your include_path, as per the error you included above, I'd have to guess that your PEAR installation has its php_dir set to some other location.

现在,如果要将PEAR安装更改为指向/usr/share/pear,则需要了解有关PEAR如何安装的信息.许多软件包使用install-time text replacement,这会将您的安装设置放入软件包的代码本身.如果回头查看pear config-show输出,将会看到其他几个* _dir设置(data_dir,bin_dir,www_dir等).因此,在安装软件包之前,请按照需要设置它们,这一点很重要.不过请放心,对于已经安装的软件包,现在还不算太晚.

Now, if you want to change your PEAR installation to point to /usr/share/pear, you need to understand something about how PEAR installs things. Many packages use install-time text replacement, which puts YOUR installation's settings into the package's code itself. If you look back at your pear config-show output, you'll see several other *_dir settings (data_dir, bin_dir, www_dir, etc.). So, it's important that these be set like you want them BEFORE you install your packages. Don't worry though, it's not too late for the packages you have installed already.

要更改PEAR设置,请使用pear config-set (setting name) (setting value),如pear config-set php_dir /usr/share/pear.由于只有php_dir绝对是必须包含在include_path中的,因此您可以保留其他设置.我通常会确保它们都指向同一个根目录,只是将所有内容都放在一个地方.

To change the PEAR settings, use pear config-set (setting name) (setting value), like pear config-set php_dir /usr/share/pear. Since only php_dir is absolutely necessary to be in your include_path, you can probably leave the other settings as they are. I usually make sure they all point into the same root directory, just to keep everything in one overall place.

一旦更改了这些设置中的任何一个,就应该为每个已经安装的软件包运行pear update.这将执行我前面提到的install-time text replacement,但是这次将使用当前的设置,即您刚刚完成的设置.首先在PEAR主软件包上运行pear update --force pear ...,您必须包含--force标志,因为PEAR会意识到您要我在已经是当前"软件包时对其进行更新并自行停止.对所有已安装的软件包运行此update之后,您的PEAR安装将把其文件放置在当前include_path希望找到它们的位置.

Once you change ANY of these settings, you should run a pear update of each and every package you already have installed. What this will do is perform that install-time text replacement I mentioned earlier, but this time will use the settings that are current, i.e. the ones you've just finished setting. Run this on the PEAR main package first, pear update --force pear... you'll have to include the --force flag because PEAR will realize you're asking me to update the package when it's already 'current' and stop itself. Once you've run this update for ALL of your installed packages, your PEAR installation will have its files placed where your current include_path is expecting to find them.

这篇关于在OSX上通过PEAR安装的PhpDocumentor无法正常工作-缺少文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆