phpuml command not found - php

I m trying to set up phpuml to generate xmi files which I intent to import using umbrello.
I have managed to get PHP_UML installed using XSL alpha package which is a dependency for PHP_UML.
Here is the output of the list command
vihaan#cd:~$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.11 stable
Console_CommandLine 1.2.0 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
PHP_UML 1.6.1 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
XML_XSLT_Wrapper 0.2.2 alpha
It seems like PHP_UML is installed but on trying to execute the phpuml command I get
vihaan#cd:~$ phpuml
phpuml: command not found
I cant figure out whats wrong?

To see where the phpuml script for installed to, use the command
$ pear list php_uml | grep phpuml

Related

How to list all versions of a pecl package

Is it possible to list all versions of a pecl package?
pecl search xdebug, for example, only lists the latest 3.0.1 version. But I'm wanting the latest 2.x version.
You can use pecl list to list all installed packages, which will return something like:
Installed packages, channel pecl.php.net:
=========================================
Package Version State
pdo_sqlsrv 5.9.0 stable
redis 5.3.3 stable
sqlsrv 5.9.0 stable
Or, you can use pecl info {package} to list information about a specific package.
So far as I know, you cannot list all available versions directly from command line. Your best bet, is just heading over to pecl.php.net and searching for your package, which will list all package versions, along with their release dates.
The pear command line installer (which is behind pecl) has no native way of listing all package versions.
You can only query the REST API yourself: https://pear.php.net/rest/r/mime_type/allreleases2.xml
The package name must be lowercase in that URL.
You can try this:
pecl install xdebug-2.9.8

Pear packages installing but not found afterwards

I am working on a mac and trying to install http_request2 and mail_mime via the pear package manager.
When I use the pear install command I see this:
$ pear install http_request2
downloading HTTP_Request2-2.2.1.tgz ...
Starting to download HTTP_Request2-2.2.1.tgz (107,339 bytes)
.........................done: 107,339 bytes
downloading Net_URL2-2.0.5.tgz ...
Starting to download Net_URL2-2.0.5.tgz (17,456 bytes)
...done: 17,456 bytes
install ok: channel://pear.php.net/Net_URL2-2.0.5
install ok: channel://pear.php.net/HTTP_Request2-2.2.1
Which leads me to believe that this is installed correctly. However, if I then run pear list -a I get the following output:
$ pear list -a
Installed packages, channel __uri:
==================================
(no packages installed)
Installed packages, channel doc.php.net:
========================================
(no packages installed)
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.11 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
Installed packages, channel pecl.php.net:
=========================================
(no packages installed)
http_request2 is not included among the installed packages, despite just being told that it was installed.
I can also run the pear install http_request2 command again and it will not give me the
ignoring installed package pear/http_request2
like it's supposed to, instead it just proceeds with the install.
I ran
pear config-get php_dir
and found http_request2 in that directory.
I tried changing the include_path variable in my php.ini file as suggested in this post: Pear Packages not working but it didn't change anything.
I would prefer not to reinstall pear if possible because I'm not experienced with this and don't want to accidentally end up with two pears, as suggested can happen here: https://stackoverflow.com/a/6596669/2718779. Any suggestions?
You probably stumble across the issue I solved in https://stackoverflow.com/a/19177767/282601 - two versions of pear installed.

How can I easily package PEAR dependencies with app?

I am working on a PHP application which leverages some PEAR packages. I want to be able to package the app in archive (e.g. tar, zip, etc) to be easily downloaded and extracted on servers to run. I do not want the servers to need PEAR for downloading or installing the dependencies. Is there a simple way of packaging the PEAR dependencies with the application?
Okay, you are probably looking for Composer, a tool for dependency management in PHP.
If I understand you correctly, this should do what you want.
There are two ways to deploy (I recommend you provide both options):
Phar
Expanded Directory of Files
In either case, if you are going to be harvesting all of the dependent component files, you can query PEAR for these.
List packages installed by the PEAR installer
pear list
Resulting List
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Console_Getopt 1.3.0 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
List files for package XML_Util
pear list-files Archive_Tar # or pear list Archive_Tar
Resulting List
Installed Files For Archive_Tar
===============================
Type Install Path
php /Users/wilmoore/local/php/versions/5.4.0/lib/php/Archive/Tar.php
doc /Users/wilmoore/local/php/versions/5.4.0/lib/php/doc/Archive_Tar/docs/Archive_Tar.txt
From here, it is simply a matter of iterating over that list and harvesting the files. You should be able to skip the lines prefixed with "doc".

Pear outputs IS_VAR

If I use pear from comandline i get strange output "IS_VAR" (whatever pear comands, php unit test's)
example "pear list"
IS_VAR
IS_VAR
IS_VAR
IS_VAR
IS_VAR
IS_VAR
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Console_Getopt 1.3.0 stable
PEAR 1.9.1 stable
PHP_CodeSniffer 1.2.2 stable
PhpDocumentor 1.4.3 stable
Structures_Graph 1.0.4 stable
Any ideas to fix?
== update ==
I debugged pear script a bit. And I founded strange behavior
class PEAR_PackageFile, method factory
$version = $version{0};
and this line throws this error. I replaced to similar functionality
$version = substr($version,0,1);
and this output disappeared. Of course i hava same issue with some other places, like UnitTests. So question why this strange output is same mystery.
Disabling traces is NOT the answer as stack traces are one of the major useful features of xdebug. It was a problem with the xdebug package itself which has been fixed (see http://bugs.xdebug.org/view.php?id=756).
If you have a distribution copy of xdebug, you can install it from PECL (may require sudo/privilege escalation):
pecl install xdebug
Otherwise, you can upgrade it from PECL:
pecl upgrade xdebug
Set xdebug.auto_trace = 0 in your php.ini file. See bug #18173.
I think you have some debug output in your pear code, or maybe even some global php prepend file. The IS_VAR is NOT part of PEAR; you somehow added that yourself to the code.

PEAR install issue, downloads but doesn't install

I saw this thread which is exactly what I've done as well, Downgraded PHP to version 5.2 on Ubuntu 10.4
When running as root I just get the download, no install message, any thoughts?
pear install Mail_Mime-1.8.0.tgz
downloading Mail_Mime-1.8.0.tgz ...
Starting to download Mail_Mime-1.8.0.tgz (31,292 bytes)
.........done: 31,292 bytes
I've looked in the phpinfo() and see nothing except the pear path
include_path .:/usr/share/php:/usr/share/pear .:/usr/share/php:/usr/share/pear
running pear list I get this
pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.3 stable
Console_Getopt 1.2.3 stable
PEAR 1.9.0 stable
Structures_Graph 1.0.2 stable
XML_Util 1.2.1 stable
please manual download Mail_Mime files and extract to /usr/share/pear/
Found a work around, not the best solution but it works. Using the Ubuntu Download Center, search for pear and install the needed packages. Most are listing with a prepending php-
php-mail

Categories