5

After trying to install PHPDocumentor with PEAR install with no success, i tried it manually as is detailed on the official website: http://www.phpdoc.org/docs/latest/for-users/installation.html

I downloaded the files and i make an alias on /usr/bin/ but when i try to execute phpdoc.php via terminal y it shows an error.

This is what i try:

> cd /usr/bin/
> ./phpdoc.php

And this is the error:

PHP Warning:  include_once(/Applications/MAMP/htdocs/phpdocumentor/src/phpDocumentor/../../vendor/autoload.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/phpdocumentor/src/phpDocumentor/Bootstrap.php on line 72
PHP Warning:  include_once(): Failed opening '/Applications/MAMP/htdocs/phpdocumentor/src/phpDocumentor/../../vendor/autoload.php' for inclusion (include_path='/Applications/MAMP/bin/php/php5.3.6/lib/php/:/Applications/MAMP/bin/php/php5.3.6/lib/bin/') in /Applications/MAMP/htdocs/phpdocumentor/src/phpDocumentor/Bootstrap.php on line 72
PHP Fatal error:  Class 'phpDocumentor_Task_Runner' not found in /Applications/MAMP/htdocs/phpdocumentor/bin/phpdoc.php on line 37

I am using Mac Os X and as you can see, i use MAMP to run Apache. What's going on here? Why it tries to open a file which doesn't exist? (because it really doesn't exist inside PHPDocumentor folder)

Thanks.

Alvaro
  • 40,778
  • 30
  • 164
  • 336

2 Answers2

4

Did you try :

curl -s http://getcomposer.org/installer | php

php composer install

on phpdocumentor2 directory (you should find composer.json)

Composer is a dependency manager for php. So it will populate phpdocumentor projet with external/vendor dependencies

Kakawait
  • 3,929
  • 6
  • 33
  • 60
  • Can you explain it a bit more? What does exactly Composer does? What should i do then? – Alvaro Apr 27 '12 at 20:11
  • composer is just a dependency manager. And as you can see on your error some dependencies are missing. – Kakawait Apr 28 '12 at 13:48
  • Ok, i have download it and i have created the composer.phar file. Then i placed it on the PHPDocumentor folder where the composer.json is. Now i run "php composer.phar install" and it throws me this error: http://s2.subirimagenes.com/privadas/1827614captura-de-pantalla.png – Alvaro Apr 28 '12 at 16:51
  • i can't open your image. Else why you don't use pear to install phpdoc ? – Kakawait Apr 28 '12 at 16:57
  • Well, i am having many troubles with PEAR. It seems i have more than one PEAR destiny and i don't get anything works with it. (and i have already waste so many time with it). The image again: http://postimage.org/image/5niqca363/ – Alvaro Apr 28 '12 at 17:00
  • Yeah you need git. It's a source code management, one of the most famous with SVN. Why ? Because the other dependencies are saved on git repository (certainly https://github.com/). Im on linux/windows env so I can't help you with git installation but it's really easy for unix like system. So you may not have any probs – Kakawait Apr 28 '12 at 17:39
  • Ok, i have installed git. So then i run "php composer.phar install" and i have it installed. Then i created a symlink from /bin/phpdoc.php to my bin folder /usr/bin and i renamed it to phpdoc. (as its said on the phpdocumentor manual installation) http://www.phpdoc.org/docs/latest/for-users/installation.html Now, i tried to run "phpdoc" and it says: "-bash: /usr/bin/phpdoc: Permission denied" then i tried it with sudo and it says "sudo: phpdoc: command not found". What am i doing wrong? – Alvaro May 05 '12 at 18:14
  • I have noticed composer uses PEAR. So... as i am having problems with PEAR... can it be that one the cause? I have finally executed phpdoc with phpdoc.php command as its said here http://www.phpdoc.org/docs/latest/for-users/basic-usage.html and i still having the same problem as the one i posted on my question. I guess composer is not doing it well... – Alvaro May 05 '12 at 18:33
  • This is what i get with "php composer.phar install": `Initializing PEAR repository http://packages.zendframework.com Packages names will be prefixed with: pear-zf2/ Initializing PEAR repository http://pear.symfony-project.com Packages names will be prefixed with: pear-symfony/` – Alvaro May 05 '12 at 18:36
  • The last message that you posted is perfectly normal; please note that you are trying to install the development version which is not fully production-ready yet. The message about permission being denied is probably because you do not have the execution flag set; try `chmod +x /usr/bin/phpdoc.php` (without or with sudo) – mvriel May 06 '12 at 19:28
3

Try this to install Composer into your MAMP php bin:

cd yourapp/ && curl -s http://getcomposer.org/installer | /Applications/MAMP/bin/php/php5.3.6/bin/php
Philip
  • 5,011
  • 2
  • 30
  • 36