Netbeans 和 PhpDocumentor
我已经下载了 Netbeans 7.0 beta,因为我想给 PhpDoc 功能一个打击,但无法让它工作。 我似乎对 netbeans 中 PhpDoc 的配置选项很感兴趣。它询问脚本位置,
但无论我输入什么,我都会收到错误;
** ERROR *****************************************************************
* Sorry, can't find the php.exe file.
* You must edit this file to point to your php.exe (CLI version!)
* [Currently set to C:\usr\local\php\cli\php.exe]
*
* NOTE: In PHP 4.2.x the PHP-CLI used to be named php-cli.exe.
* PHP 4.3.x renamed it php.exe but stores it in a subdir
* called /cli/php.exe
* E.g. for PHP 4.2 C:\phpdev\php-4.2-Win32\php-cli.exe
* for PHP 4.3 C:\phpdev\php-4.3-Win32\cli\php.exe
**************************************************************************
Press any key to continue . . .
设置是在 Windows 计算机上运行 Netbeans 和 xampp。
非常感谢任何和所有的帮助。
I have downloaded Netbeans 7.0 beta as I wanted to give the PhpDoc functionality a bash, but can't get it to work.
I seem to be falling over on the configuration options for PhpDoc in netbeans. It is asking for the script location,
but whatever I enter I get the error;
** ERROR *****************************************************************
* Sorry, can't find the php.exe file.
* You must edit this file to point to your php.exe (CLI version!)
* [Currently set to C:\usr\local\php\cli\php.exe]
*
* NOTE: In PHP 4.2.x the PHP-CLI used to be named php-cli.exe.
* PHP 4.3.x renamed it php.exe but stores it in a subdir
* called /cli/php.exe
* E.g. for PHP 4.2 C:\phpdev\php-4.2-Win32\php-cli.exe
* for PHP 4.3 C:\phpdev\php-4.3-Win32\cli\php.exe
**************************************************************************
Press any key to continue . . .
The set-up is Netbeans and xampp running on a windows machine.
Any and all help greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
该错误表明 php.exe 可执行文件不在您的 Windows“路径”中,因此,当 Windows 尝试运行 phpdoc 脚本时,它不知道如何运行。幸运的是,phpdoc 脚本本身会检查此情况并在您发布的错误文本中向您解释。否则,Windows 错误将更加普遍,并且可能没有帮助。
您需要确定 php.exe 文件所在的位置。然后,编辑 phpdoc.bat 脚本文件本身以硬编码绝对路径。查找开头附近设置 phpCli 值的行。您应该在此处放置 php.exe 文件的绝对路径。
顺便说一句,我建议 NetBeans 中的“PhpDoc 脚本”设置应该显式调用 phpdoc.bat 脚本,而不仅仅是“phpdoc”,例如 D:\xampp\php\phpdoc.bat,因为这两个文件实际上都存在。我知道,如果您在 foo 不存在且 foo.bat 确实存在时告诉它执行“foo”,Windows 通常会查找“foo.bat”,但由于 phpdoc 和 phpdoc.bat 都存在,...我认为Windows 尝试直接运行 phpdoc 而不是 phpdoc.bat 会给你带来麻烦。
此外,我看到您将 phpdoc.bat 文件本身列为 phpdoc 脚本的第一个“参数”。一旦你克服了“找不到 php.exe”错误,这可能会给你带来一些悲伤。您应该删除它...在命名脚本本身之后您应该给出的唯一参数是 phpDocumentor 期望的有效参数,特别是它需要的参数 -- -o 表示输出模板, -t 表示其中要编写文档文件,-d 或 -f 告诉它您想要记录的 PHP 代码在哪里。
That error indicates that the php.exe executable file is not in your Windows "PATH", and as such, when Windows tries to run the phpdoc script, it doesn't know how. Fortunately, the phpdoc script itself checks for this condition and explains it to you, in the error text you posted. Otherwise, the Windows error would have been much more generic and probably unhelpful.
You need to determine where your php.exe file is located. Then, edit the phpdoc.bat script file itself to hardcode the absolute path. Look for the line near the beginning that SETs the phpCli value. That is where you should place the absolute path to your php.exe file.
As an aside, I would suggest that your "PhpDoc script" setting in NetBeans should explicitly call the phpdoc.bat script rather than just "phpdoc", e.g. D:\xampp\php\phpdoc.bat, since both files actually exist. I know that Windows will typically look for "foo.bat" if you tell it to execute "foo" when foo doesn't exist and foo.bat does exist, but since phpdoc and phpdoc.bat both exist, ... I think that Windows trying to run phpdoc directly rather than phpdoc.bat will give you trouble.
Further, I see that you have the phpdoc.bat file itself listed as the first "argument" to the phpdoc script. That will probably cause you some grief once you get past the "can't find php.exe" error. You should remove that... the only arguments you should give after naming the script itself are the valid arguments that phpDocumentor expects, particularly the ones it requires -- -o for output template, -t for where to write the doc files, -d or -f to tell it where the PHP code is that you want documented.
就我而言,在版本 2 中:
我将 phpdoc.bat 中的最后一行更改
为
%PHP_PERAR_BIN_DIR%
在本例中为空 &反斜杠导致查找 phpdoc.php 文件时出错for my case, in the version 2:
i changed the last line in phpdoc.bat:
to
%PHP_PERAR_BIN_DIR%
in this case is empty & the backslash makes an error finding the phpdoc.php file我终于找到了在 Netbeans Windows 中使用 phpdoc 的简单方法!
梨?放下它。问题实在是太多了
例如,我将 phpdocumentor 文件夹放在 d:\programs\xampp\php\phpdoc 中。修改 phpdoc.bat 文件:
然后在 Netbeans 中,将其放入 phpdoc 脚本:
请注意,当您设置目标时(右键单击项目 -> 属性 -> phpdoc),您需要手动将反斜杠更改为正斜杠。
祝你好运!
附言。请注意,您还可以直接从 dos 运行 phpdoc 批处理文件。您不需要通过 netbeans 来完成此操作。
I finally figured out an easy way to use phpdoc in Netbeans Windows!
Pear? Drop it. There's way too many problems.
So for example, I put my phpdocumentor folder in d:\programs\xampp\php\phpdoc. Modifying the phpdoc.bat file:
Then in Netbeans, you put this for the phpdoc script:
Note that when you set the target (right click on project -> properties -> phpdoc), you will need to manually change the backslashes to forward slashes.
Good luck!
PS. Note that you can also run the phpdoc batch file directly from dos. You don't need to do it through netbeans.