Netbeans 和 PhpDocumentor

发布于 2024-10-03 23:50:10 字数 902 浏览 4 评论 0原文

我已经下载了 Netbeans 7.0 beta,因为我想给 PhpDoc 功能一个打击,但无法让它工作。 我似乎对 netbeans 中 PhpDoc 的配置选项很感兴趣。它询问脚本位置, alt text

但无论我输入什么,我都会收到错误;

** 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,
alt text

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

初与友歌 2024-10-10 23:50:10

该错误表明 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.

西瑶 2024-10-10 23:50:10

就我而言,在版本 2 中:
我将 phpdoc.bat 中的最后一行更改

"%PHPBIN%" "%PHP_PERAR_BIN_DIR%\phpdoc.php" %*

"%PHPBIN%" "phpdoc.php" %*

%PHP_PERAR_BIN_DIR% 在本例中为空 &反斜杠导致查找 phpdoc.php 文件时出错

for my case, in the version 2:
i changed the last line in phpdoc.bat:

"%PHPBIN%" "%PHP_PERAR_BIN_DIR%\phpdoc.php" %*

to

"%PHPBIN%" "phpdoc.php" %*

%PHP_PERAR_BIN_DIR% in this case is empty & the backslash makes an error finding the phpdoc.php file

冧九 2024-10-10 23:50:10

我终于找到了在 Netbeans Windows 中使用 phpdoc 的简单方法!

梨?放下它。问题实在是太多了

  1. 直接下载 - http://sourceforge.net/projects/phpdocu/files/
  2. 下载tar 文件,而不是 zip。 zip 被窃听,将输出 2 个字母扩展名而不是 3 个(即 .cs 而不是 .css)(从 1.4.3 开始)
  3. 将其解压缩到任何您想要的位置
  4. 打开 phpdoc.bat 文件,并进行 2 处更改
  5. a) 更改phpcli 路径
  6. b) 添加代码以导航到该目录。

例如,我将 phpdocumentor 文件夹放在 d:\programs\xampp\php\phpdoc 中。修改 phpdoc.bat 文件:

    SET phpCli=d:\programs\xampp\php\php.exe
    d:
    cd d:\programs\xampp\php\phpdoc

然后在 Netbeans 中,将其放入 phpdoc 脚本:

    D:\programs\xampp\php\phpdoc\phpdoc.bat -o HTML:frames:earthli

请注意,当您设置目标时(右键单击项目 -> 属性 -> phpdoc),您需要手动将反斜杠更改为正斜杠。

  • 正确 - D:/programs/xampp/htdocs/project/phpdoc
  • 错误 - D:\programs\xampp\htdocs\project\phpdoc (当您使用浏览按钮时将生成该文件)

祝你好运!

附言。请注意,您还可以直接从 dos 运行 phpdoc 批处理文件。您不需要通过 netbeans 来完成此操作。

    d:\programs\xampp\php\phpdoc\phpdoc.bat -d D:\programs\xampp\htdocs\project -t D:\programs\xampp\htdocs\project\phpdoc -o HTML:frames:phpedit

I finally figured out an easy way to use phpdoc in Netbeans Windows!

Pear? Drop it. There's way too many problems.

  1. Download it directly - http://sourceforge.net/projects/phpdocu/files/
  2. Download the tar file, not the zip. The zip is bugged and will output 2 letter extensions instead of 3 (ie, .cs instead of .css) (as of 1.4.3)
  3. Unzip it anywhere you want
  4. Open up the phpdoc.bat file, and make 2 changes
  5. a) Change the phpcli path
  6. b) Add in code to navigate to the directory.

So for example, I put my phpdocumentor folder in d:\programs\xampp\php\phpdoc. Modifying the phpdoc.bat file:

    SET phpCli=d:\programs\xampp\php\php.exe
    d:
    cd d:\programs\xampp\php\phpdoc

Then in Netbeans, you put this for the phpdoc script:

    D:\programs\xampp\php\phpdoc\phpdoc.bat -o HTML:frames:earthli

Note that when you set the target (right click on project -> properties -> phpdoc), you will need to manually change the backslashes to forward slashes.

  • Correct - D:/programs/xampp/htdocs/project/phpdoc
  • Incorrect - D:\programs\xampp\htdocs\project\phpdoc (this will be generated when you use the browse button)

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.

    d:\programs\xampp\php\phpdoc\phpdoc.bat -d D:\programs\xampp\htdocs\project -t D:\programs\xampp\htdocs\project\phpdoc -o HTML:frames:phpedit
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文