Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans and PhpDocumentor

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.

like image 237
Rooneyl Avatar asked Nov 23 '10 15:11

Rooneyl


1 Answers

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.

like image 129
ashnazg Avatar answered Sep 21 '22 00:09

ashnazg