问题
I'm trying to create a php documentation on my local XAMPP host (on Windows 7) with phpDocumentor.phar (v2.). It gives me (after parsing all the files) this error:
Unable to find the dot
command of the GraphViz package. Is GraphViz correctly installed and present in your path?
I searched a lot, but nothing helps. What does 'path' means? If I open a command box at any location I can start the dot.exe (which gives me no output but waiting prompt). In my environment path variable the bin folders is added. GraphViz is installed correct in Program Files and runs standalone.
What could I do or check?
回答1:
In order to get GraphViz running properly with a Windows based phpdoc installation, just put the GraphViz program directory (c:\some\path\graphviz\release\bin
) to the Windows Path
system variable.
In order to do this, follow these steps (Win7, please provide your OS version if this doesn't apply to your situation):
- From the desktop, right-click
My Computer
and clickProperties
. - In the
System Properties
window, click on theAdvanced
tab. - In the
Advanced
section, click theEnvironment Variables
button. - In the
Environment Variables
window, highlight thePath
variable in theSystems Variable
section and click the Edit button.
Different directories are separated with a semicolon:
C:\Program Files;C:\Winnt;C:\Winnt\System32
It will most likely look a bit different in your enviroment, so please just take this for an example. Just add the GraphViz Path at the end like this:
C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\somefolder\graphviz\release\bin
I'm not too sure if you have to reboot your system after changing this value. You had to do this in the old days of Win2k, and I just don't know if this still applies to modern Windows versions. It surely doesn't hurt!
After this, phpdoc should be able to find the dot
command.
回答2:
The steps to resolve this error are:
download Windows Packages from https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)
来源:https://stackoverflow.com/questions/28194072/dont-get-graphviz-and-phpdocumentor-to-work