6

Although I followed the instruction to install phpDocumentor, Command line doesn't seem to respond to phpdoc

Given error: Command 'phpdoc' not found, did you mean: command 'phploc' from deb phploc command 'phpdox' from deb phpdox Try: sudo apt install

I followed these steps to install phpdoc and it seemed to work

pear channel-discover pear.phpdoc.org

pear install phpdoc/phpDocumentor

When the installation completed I tried to run phpdoc -h and it did not work.

Using: 7.2.16

OS: Ubuntu 18.04.2 LTS

I appreciate any attempt to help.

9
  • Could you check the section Modifying php.ini from the pear documentation and try to check if that works. pear.php.net/manual/en/installation.checking.php Commented Apr 11, 2019 at 9:15
  • Did you sudo those install commands? (Just curious, I just installed on Linux Mint 18.1 without problems) Did you try any of the other installation methods? Commented Apr 11, 2019 at 9:22
  • Yes, but it doesn't look like the problem is with the installation @kerbholz Commented Apr 11, 2019 at 9:23
  • @JensV I actually added include_path=".:/home/user/pear/share/pear" manually. but it doesn't have anything to do with phpdoc am I right? beacouse pear already works. Commented Apr 11, 2019 at 9:25
  • What does whereis phpdoc return? Is that path in your PATH? (Mine says phpdoc: /usr/bin/phpdoc) Commented Apr 11, 2019 at 9:26

1 Answer 1

1

Check directories in your your path with

echo $PATH

phpdoc should be in /usr/bin. Check it with

ls -l /usr/bin/php*

If phpdoc is there, add exec perms with

chmod +x /usr/bin/phpdoc

But most likely he is not in the path, so go for a search

find . -name testfile.txt

When you have identified where phpdoc is, you must either add the folder where it is located to the PATH, or create a symbolic link (symln :

to this file in a directory of the PATH.

For PATH extension, do :

export PATH=$PATH:/my/custom/path

For a symlink, cd to a directory in your PATH. After that do

ln -s /my/custom/path/phpdoc

A good custom binary directory is /usr/local/bin.

You have to perform all this task as root or with sudo.

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

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.