18

I'm trying to use phpDocumentor (for the first time, I have no idea what I'm doing). Actually, I want to use it only with SublimeText 2 and this plugin. Can you guide me step by step what should I do to make it working? Here's what I've done now: (I'm using Windows 7) Downloaded phpDocumentor from here and placed it somewhere. I've created system PATH's for phpdoc/bin (so phpdoc.bat can be executed by sublime plugin) and then also added system path to php (from WAMPserver installation)

When I try to use my plugin (or execute phpdoc inside console window) I get this error:

Could not open input file: \phpdoc.php

2
  • 1
    \phpdoc.php would suggest that it's looking for the script in the ROOT of whatever drive this is on, and not in c:\inetpub\....\phpdoc\bin Commented May 1, 2012 at 21:36
  • @MarcB So how can I work it out? Can I provide actual path to the script somewhere? Commented May 1, 2012 at 21:45

7 Answers 7

16

Run:

pear

it will set %PHP_PEAR_PHP_BIN% for you.

Sign up to request clarification or add additional context in comments.

2 Comments

were do you run pear from? I get , 'pear' is not recognized as an internal or external command, operable program or batch file.
@themis : In windows you must set your php directory as a system var thus you will have php (for php.exe) and pear (for pear.bat) from your php dir. To do this go to your system properties (advanced in win7) click Environment Variables. Under the System variables change the var "Path" and put your php dir separated via a semicolon for example : ";x:\xamp\php"
10

You will need to set the environmental path for "PHP_PEAR_BIN_DIR" to the directory where "phpdoc.php" is.

Comments

10

I have changed phpdoc.bat file to point to exactly location of phpdoc.php

@echo off
if "%PHPBIN%" == "" set PHPBIN=php.exe
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "C:\wamp\bin\php\php5.3.10\phpdoc.php" %*

Comments

4

On my windows 7 system, I have my set up phpDocumentor (version 2.6.1) in wamp and my paths are like:

D:\Projects\wamp\www\phpDocumentor
D:\Projects\wamp\www\phpDocumentor\bin 

Now what I did is I edited the phpdoc.bat file located at path:

D:\Projects\wamp\www\phpDocumentor\bin\phpdoc.bat

It contained code as shown below:

@echo off
if "%PHPBIN%" == "" set PHPBIN=php.exe
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "D:\Projects\wamp\www\phpDocumentor\bin\phpdoc" %*

So, I edited the last line "%PHPBIN%" "%PHP_PEAR_BIN_DIR%\phpdoc" %* with new code "%PHPBIN%" "phpdoc" %*. After phpdoc.bat looked like :

@echo off
if "%PHPBIN%" == "" set PHPBIN=php.exe
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "phpdoc" %*

Thereafter I again ran the below command in cmd:

D:\Projects\wamp\www\phpDocumentor\bin>phpdoc

And the output was like:

D:\Projects\wamp\www\phpDocumentor\bin>phpdoc

Collecting files .. OK
Initializing parser .. OK
Parsing files

  [Exception]
  No parsable files were found, did you specify any using the -f or -d parame
  ter?

project:run [-t|--target[="..."]] [-f|--filename[="..."]] [-d|--directory[="..."
]] [--encoding[="..."]] [-e|--extensions[="..."]] [-i|--ignore[="..."]] [--ignor
e-tags[="..."]] [--hidden] [--ignore-symlinks] [-m|--markers[="..."]] [--title[=
"..."]] [--force] [--validate] [--visibility[="..."]] [--defaultpackagename[="..
."]] [--sourcecode] [-p|--progressbar] [--template[="..."]] [--parseprivate] [--
log[="..."]]

D:\Projects\wamp\www\phpDocumentor\bin>

So, the output showed that it worked successfully !!

Comments

0

PHP's include_path will need the path to the directory that contains that phpdoc.php file. Otherwise, none of the phpDocumentor code that uses require/include statements with relative paths will be able to find anything.

Comments

0

I just encountered this on Windows 7 having installed phpDocumentor2 via PEAR. I found that running:

phpdoc -d . -t docs

in an elevated command prompt did the trick - I suspect there's still some PATH issue on my machine that makes that the case, but having done all the default install steps for both PEAR and phpDocumentor it has proven the quickest workaround I've found.

Comments

0

I've got the same error message, the already made answers brought me to the right path.

As I don't use wamp/xampp or any of these programms, I thought: why don't run it directly with PHP?

I had already installed PHP7.0.x globally through WebPI.

Only php needs to be prefixed to the command, everything worked:

php .\phpDocumentor\bin\phpdoc -d .\src\ -t .\dst\

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.