Unable to run phpdoc command after installing phpdoc/phpDocumentor package
Asked Answered
D

1

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.

Defect answered 11/4, 2019 at 9:5 Comment(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.phpAdoration
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?Creekmore
Yes, but it doesn't look like the problem is with the installation @kerbholzDefect
@Adoration 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.Defect
What does whereis phpdoc return? Is that path in your PATH? (Mine says phpdoc: /usr/bin/phpdoc)Creekmore
phpdoc: followed by nothing, can I add it manually?Defect
It seems like it actually didn't get installed correctly. As kerbholz points out, there should be a binary there. Either /usr/bin isn't in your $PATH (check with echo $PATH) which is very unlikely, or something went wrong with the installation. Try to reinstall it, making sure you run it as root. Also pay attention to any potential error messages returned by pear.Adoration
Ok I'm trying it nowDefect
@Adoration I tried it and it gave the message install ok as it's supposed to, but still no progressDefect
V
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.

Vassell answered 22/4, 2019 at 16:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.