Trying to install PHP_Depend - php

I'm trying to install PHP_Depend as here below but I'm getting that error you can see..
javier#javier-mbp:/var/www$ pear channel-discover pear.pdepend.org
Channel "pear.pdepend.org" is already initialized
javier#javier-mbp:/var/www$ pear remote-list -c pdepend
Channel pdepend Available packages:
===================================
Package Version
PHP_CodeSniffer_Standards_PDepend2 -n/a-
PHP_Depend 0.10.6
PHP_Depend_Log_Arbit 1.0.0
staticReflection -n/a-
javier#javier-mbp:/var/www$ pear install pdepend/PHP_Depend
No releases available for package "pear.pdepend.org/PHP_Depend"
install failed
Any help?
Javi

You no longer have to install the -beta package (as shown here - http://pear.pdepend.org/).
If you're still getting this error, you may have an issue with your pear cache.
Try running:
pear clear-cache
And then try installing again.
Another thing I'd like to make mention of: PHP_Depend is now available on Packagist as 'pdepend' via Composer: http://pdepend.org/news/pdepend-1.1.0-released.html

As stated in http://pdepend.org/documentation/handbook/installation/pear-installer.html:
$ pear install pdepend/PHP_Depend-beta
Note the "beta" in it. By default, the pear installer only installs software marked as stable, which phpdepend is not.

Related

Composer update: The requested PHP extension ext-http missing

I am creating a php website using the symfony framework and composer.
Operating system: Windows 10
PHP version: 7.3.2
Symfony: 4.2.3 (env: dev, debug: true)
Composer: 1.8.4 (2019-02-11)
When I try to do compose update inside the projects folder or when I try to install a bundle using composer require symfony/swiftmailer-bundle I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-http * is missing from your system.
Install or enable PHP's http extension.
(It says 'Problem 1', but it is the only problem listed.)
I already looked for the extension in my php.ini file, but I can't find it. Do I need to install an extension manually? If so, where can I find it?
Thanks in advance!
Update:
It might be worth looking at the other answers too. Since I'm no longer working with PHP, I'm not going to set up a project and try to recreate the problem I had just to test the new suggested solutions. If another answer did help you, give it a vote '^' this way I know which answers are helpful.
The solution is found. For some reason my composer.json contained "ext-http": "*".
"require": {
"ext-http": "*"
}
Removing this line fixed the problem. I don't know why it contained "ext-http": "*" and I don't fully understand why removing it would fix the problem. (Is it because it is looking for the extension, but can not find it?)
(Thank you to everyone trying to help me fix the problem!)
in my case i'm using ubuntu, hope this solve the problem.
sudo apt install php-http
php-http is a standard which is implemented by different packages. ext-http is the Composer way to tell that your application requires at least one of those packages. See the section called "Composer virtual packages" at http://docs.php-http.org/en/latest/clients.html for additional details.
Differently than other packages, the ext-... lines do not actually install anything via composer, they just make composer check that you have some required dependency.
Usually you can just install the corresponding PHP library, e.g. ext-zip means that you need to install php-zip. In this case, there is no single PHP library but a series of compatible libraries.
You should be able to fix your issue by installing one of the provided packages, e.g.
composer require php-http/curl-client
For those who encountered with this problem:
- The requested PHP extension ext-http * is missing from your system.
The solution is just to install PHP extension:
sudo apt install php-pecl-http
In case someone needs it, one can also install it with pecl
(it needs extensions raphf and propro loaded to build):
yum install libcurl-devel brotli-devel
pecl install pecl_http
...
Build process completed successfully
Installing '/usr/lib64/php/modules/http.so'
Installing '/usr/include/php/ext/http/php_http.h'
Installing '/usr/include/php/ext/http/php_http_api.h'
Installing '/usr/include/php/ext/http/php_http_buffer.h'
Installing '/usr/include/php/ext/http/php_http_client.h'
Installing '/usr/include/php/ext/http/php_http_client_curl.h'
Installing '/usr/include/php/ext/http/php_http_client_curl_event.h'
Installing '/usr/include/php/ext/http/php_http_client_curl_user.h'
Installing '/usr/include/php/ext/http/php_http_client_request.h'
Installing '/usr/include/php/ext/http/php_http_client_response.h'
Installing '/usr/include/php/ext/http/php_http_cookie.h'
Installing '/usr/include/php/ext/http/php_http_curl.h'
Installing '/usr/include/php/ext/http/php_http_encoding.h'
Installing '/usr/include/php/ext/http/php_http_encoding_brotli.h'
Installing '/usr/include/php/ext/http/php_http_encoding_zlib.h'
Installing '/usr/include/php/ext/http/php_http_env.h'
Installing '/usr/include/php/ext/http/php_http_env_request.h'
Installing '/usr/include/php/ext/http/php_http_env_response.h'
Installing '/usr/include/php/ext/http/php_http_etag.h'
Installing '/usr/include/php/ext/http/php_http_exception.h'
Installing '/usr/include/php/ext/http/php_http_filter.h'
Installing '/usr/include/php/ext/http/php_http_header.h'
Installing '/usr/include/php/ext/http/php_http_header_parser.h'
Installing '/usr/include/php/ext/http/php_http_info.h'
Installing '/usr/include/php/ext/http/php_http_message.h'
Installing '/usr/include/php/ext/http/php_http_message_body.h'
Installing '/usr/include/php/ext/http/php_http_message_parser.h'
Installing '/usr/include/php/ext/http/php_http_misc.h'
Installing '/usr/include/php/ext/http/php_http_negotiate.h'
Installing '/usr/include/php/ext/http/php_http_object.h'
Installing '/usr/include/php/ext/http/php_http_options.h'
Installing '/usr/include/php/ext/http/php_http_params.h'
Installing '/usr/include/php/ext/http/php_http_querystring.h'
Installing '/usr/include/php/ext/http/php_http_response_codes.h'
Installing '/usr/include/php/ext/http/php_http_url.h'
Installing '/usr/include/php/ext/http/php_http_utf8.h'
Installing '/usr/include/php/ext/http/php_http_version.h'
install ok: channel://pecl.php.net/pecl_http-3.2.3
configuration option "php_ini" is not set to php.ini location
You should add "extension=http.so" to php.ini
I had the same problem too.
My problem was that when I use RuntimeException class, I made a mistake by import use http\Exception\RuntimeException; instead of the standard one use RuntimeException. And the class http\Exception\RuntimeException; required ext-http extension.
So my suggestion is that, you should search your all project and check whether you made the same mistake as mine or not. You can search all by keyword use http\.
Btw I don't think install or unstall ext-http plugin will solve the problem.
According to PHP Official Documentation, You'll have to find your extension in php.ini and uncomment it OR add it in general. It's probably something like extension=php_http.dll.
Have you already tried the options here for similar issues?
Composer: The requested PHP extension ext-intl * is missing from your system
I have not experienced this issue on WAMP stacks yet... but it looks like some related articles (where this particular item 'ext-http' is not the issue) could be helpful.
When I've had similar issues on LAMP stacks, it usually meant that I did need to install the item mentioned... though sometimes Composer was a bit misleading as to the actual item needed.
Example #1 (LAMP)... actual item described was needed:
composer require phpoffice/phpspreadsheet
Error produced: missing php-mstring
Solution:
yum install php-mbstring
Example #2 (LAMP)... something slightly different than the item described was needed:
composer require phpoffice/phpspreadsheet
Error produced: missing ext-zip
Solution:
yum install php-pecl-zip
Also, perhaps running composer in verbose mode?
But, I think your best bet to start is the first link provided in this answer (and then looking through similar WAMP Composer missing item issues).
Had the same problem in composer.json file. Also discovered, that I have an "ext-http": "*". To solve this problem just delete the "ext-http": "*" and try to install package again. Worked for me, hope for you too :)
In my case, the combination worked (Ubuntu php7.4)
sudo apt install php-pear
pecl install pecl_http

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.

Phpqatools install failed

Recently i tried to install phpqatools, but when I try:
sudo pear install --alldeps pear.phpqatools.org/phpqatools
I receive the message:
No releases available for package "pear.phpqatools.org/phpqatools"
install failed
Someone knows how to solve this?
We had this same problem.
Apparently phpqatools decided to no longer offer a pear channel. You need to install the tools through composer now.
Or you may have this problem : http://pear.php.net/bugs/bug.php?id=20203

Having trouble installing predis pear package osx

I am trying to install predis through pear in the osx terminal and getting this error:
$ pear install pearhub/predis
Attempting to discover channel "pearhub"...
Attempting fallback to https instead of http on channel "pearhub"...
unknown channel "pearhub" in "pearhub/predis"
invalid package name/package file "pearhub/predis"
install failed
Do you know what I have to do to discover pearhub?
PEAR needs to know what "pearhub" means. In this case, it means "pearhub.org", a project repository. Discover like this:
$ pear channel-discover pearhub.org
$ pear install pearhub/predis
Predis git repository https://github.com/nrk/predis/ contains link to PEAR channel http://pear.nrk.io/ and following instruction here:
pear channel-discover pear.nrk.io
pear remote-list -c nrk
pear install nrk/predis

phpunit require_once() error

I recently installed phpunit on my server via the pear installer.
When I go to run a test I get the following error:
PHP Warning: require_once(PHPUnit/Util/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 44
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Util/Filter.php' (include_path='.:/usr/bin/php') in /usr/bin/phpunit on line 44
After doing some searching, I tried making some modifications to the include_path in my php.ini file on the server. But that hasn't done a thing.
Any idea what might be causing this?
UPDATE: As of 2013 November and Ubuntu 12.04 these 2 commands should suffice:
sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit
The following is an older answer.
It's a known problem , although almost a year and a half had passed. Read about it here
The code coverage must be installed in order for phpunit to work properly
What you need to do is covered here:
code coverage installation through PEAR
Basically you have to type (with sudo if you don't have permissions, taken that phpunit is already installed):
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear install phpunit/PHP_CodeCoverage
I had this problem on OS X. Fixed it with the following commands which force all the php dependencies to be reinstalled, which included a couple of packages from other channels that were not already configured:
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear install --alldeps phpunit/PHPUnit
https://bugs.launchpad.net/ubuntu/+source/phpunit/+bug/701544
and specially this comment for ubuntu 11.04 and may be for some others too
even though i did ths steps as recommended above, i didn't get it to work but after i upgraded pear from 1.9.1 to 1.9.2 it's working perfectly just do this
speshu#speshu-laptop:~$ sudo pear upgrade pear
downloading PEAR-1.9.2.tgz ...
Starting to download PEAR-1.9.2.tgz (295,120 bytes)
.....................................................done: 295,120 bytes
upgrade ok: channel://pear.php.net/PEAR-1.9.2
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
If it is the first time you are using PEAR, perhaps you have not configured the include path right. Take a look at the appropriate section in the PEAR manual.
https://github.com/sebastianbergmann/php-code-coverage
sb#ubuntu ~ % pear channel-discover pear.phpunit.de
Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded
sb#ubuntu ~ % pear channel-discover components.ez.no
Adding Channel "components.ez.no" succeeded
Discovery of channel "components.ez.no" succeeded
sb#vmware ~ % pear install phpunit/PHP_CodeCoverage
downloading PHP_CodeCoverage-0.9.0.tgz ...
Starting to download PHP_CodeCoverage-0.9.0.tgz (108,376 bytes)
.........................done: 108,376 bytes
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-0.9.0
(include_path='.:/usr/bin/php')
Are you sure you added it to the include_path?
It might also help if we saw your ini file, and the include_path snippet in it...
I found it!
Looks like PEAR installed PHPUnit in /usr/share/pear. Not sure why but that's where it is. Must be a (mt) thing.
Anyway, I'm all set. Thanks for the help.
This is also what happens if you have an out-of-date or incomplete PHPUnit install. Please be aware that after you set up PEAR, you must add the PHPUnit.de channel in order to get an up-to-date package.
In my case, I solved it by adding /usr/share/php/PEAR to the include_path.
I'm using Ubuntu 10.04.2.
If you have problems with accessing components try another way.
Install pear
sudo apt-get install php-pear
Install phpunit by using pear.
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
Install phpunit/Selenium, but first you need to install curl module
sudo apt-get install php5-curl
pear install phpunit/PHPUnit_Selenium
I was having the same problem. Netbeans was reporting that the phpunit version was too old (which it wasn't). Running the phpunit script directly showed the above messages.
I solved it adding:
include_path=".:/usr/share/php"
To /etc/php5/cli/php.ini
Please NOTE that the php.ini file is the one for php CLI (command) not the php.ini used for apache!
My original problem was I could not get the command line version of php (yum install php or yum install php-cli) to upgrade to => php5.2.7 I was stuck on 5.1 version
I had already compiled php 5.3.3 for use with apache. So I setup a symbolic link from /usr/bin/php (the command line default) to my compiled version in /var/php5/bin/php to get the command line php reporting 5.3.3
Then I refollowed the pear install steps for phpunit
But it still needed the code coverage stuff when I ran phpunit.
So I hunted code coverage down under /var/php5/lib/php/PHP/CodeCoverage and added that to the include path in php.ini
include_path=".:/var/php5/lib/php/"
Make sure to add it to the include path without /PHP because phpunit starts at PHP/ (notice caps) looking for Code Coverage
Failed opening required 'PHP/CodeCoverage/Filter.php'
I had this problem . I was developing a zend framework site. Finally I manage to solve it by removing the zend installation and removing/commenting the include path in bath php.ini files in apache and cli. To develop site with zend we don't need to have zend installed. Insted we can copy the library to our site folder
For me dividing test's in multiple batches helped.
You can solve this issue by redefining the environment variables in PEAR.
This is how I solved the problem and I used Ubuntu 12.10
http://rkrants.blogspot.in/2013/01/installing-phpunitpear-in-ubuntu-1210.html
In short it defines the paths and then reinstalls phpunit
Ubuntu 12.04:
sudo pear channel-discover pear.symfony.com
sudo pear install --alldeps phpunit/PHPUnit
I had the same issue with Windows 8
Similar to the top answer, I needed to start the command line, however make sure to run cmd.exe as administrator. Then the two commands
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit

Categories