PEAR - Package installation (XML_Query2XML) - php

I was trying to install XML_Query2XML package but I am getting below error (I tried to install without -o parameter too, but got same error)
C:\Users\devdiu>pear install -o XML_Query2XML
No releases available for package pear.php.net/XML_Query2XML
install failed
Then I tried to install with specific version (which is latest as on today)
C:\Users\devdiu>pear install -o XML_Query2XML-1.7.2
No releases available for package "pear.php.net/XML_Query2XML"
install failed
Does any one know the issue?

I already tried that too. I have no clue why its giving error. I have installed it 3 times before I started getting this error. I actually wanted to ask different question but I stuck up at this one now.
Alternate way
I am manually copying the files into PEAR folder, to avoid further wastage of time
SOLUTION:
I got the solution in the link Lukas reconmended and resolved using this command (there are multiple accepted solutions there)
shell>pear clear-cache

Related

Laravel composer install giving error "Your lock file does not contain a compatible set of packages please run composer update"

I have been writing laravel code for quite sometime. Currently, I tried cloning a project from github and editing locally. I installed composer in my project directory but a vendor folder was not included, I tried to run composer install but I gives me this error
Your lock file does not contain a compatible set of packages. Please run composer update
How do I resolve this?
Note: I have tried running composer update on previous clones and that didn't work.
Run this command:
composer install --ignore-platform-reqs
or
composer update --ignore-platform-reqs
Disclaimer, this solution will not fix the issue for PHP 8 projects.
In most cases this happens because of PHP 8 (In my case it was GitHub CI actions automatically started using PHP 8 even though my project is php 7.4)
If you have multiple PHP installations (E.g. 7.4 and 8 on the same server), this is how you can fix it.
Specify your php version in your composer.json file
"config": {
"platform": {
"php": "7.3"
}
},
If you have the lock file already committed, run composer update after you adding above line in to the composer.json and then commit the new lock file. (Please be aware composer update will upgrade your packages to latest versions)
I solved this problem with this command:
composer self-update --1
It probably works because at time that the project was developed, composer was on another version and when change the Major version from 1 to 2 the compatibility was broke. With this command you downgrade composer and probably going to solve this
You should try running composer update --lock that will update all packages and recreate the compose.lock file.
Either you can delete the composer.lock file and run composer install that will also recreate the .lock file.
This resolved my issue.
I had this error with Github Actions trying to deploy a Laravel app, this is probably different than the OP's case but none of the suggestions worked for me. Adding my answer here just in case there is someone else out there with a similar problem to mine.
I had to disable -q in Github Actions and see that it was complaining about extensions not being installed.
Make sure your require section of composer's php extensions matches the extensions: in your github action file for shivammathur/setup-php#v2 and it will deploy again
Recently I've just come across of this error when I tried to run my Laravel 7 project which required php v7.* with php v8. As I forgot my php version I just tried bunch of composer command, but just got error after error.
Anyway, to solve this just downgrade/upgrade php version as required. Just search how to do that in youtube.
you can see your project required php version in composer.json file (just if you wonder)
Also you can try following way (But though it didn't worked for me, seems it helped quite some people)
-- Open composer.json file and change php version to something like this: "php": "^7.3|^8.1"
-- Then run composer update
I faced this problem with my cakephp project in garuda linux (arch based)
Fix :
Install php-intl using sudo pacman -S php-intl
Enable php intl by editing php config ( in my case /etc/php/php.ini ) .
add extension=intl or uncomment the existing one
restart apache or whatever you are using
I had the same error deploying another project with composer, but the problem was a missing php extension.
I understand you solve your problem but for anyone seeing the same error message, here is a general guidance :
The error message Your lock file does not contain a compatible set of packages. Please run composer update is shown each time there is a conflict during the dependency solving step of composer install. (see the relevant part in composer source code)
It doesn't inform on the real problem though, and it could be hard to guess.
To get the exact explanation you can add --verbose option to composer install command (the option is available to any composer command (see the doc)) : composer install --verbose
It will give you the full message explaining what exactly is preventing composer install from completing (package version conflict, missing php extension, etc.), then you'll be able to fix the problem.
Hope this could help.
In my case this problem is occuring in Ubuntu 20.04 Desktop. This is due to some missing packages.
I ran the following commands to install some packages then rerun Composer install and its working properly. The commands are:
sudo apt-get install php-mbstring
sudo apt-get install php-xml
Then rerun composer install

Problem with Laravel/Installer + Composer

How are you doing?
Well, I'm having an issue trying to install laravel on my production server. If I run the installation command, at the end of the process it returns me an error like:
[RuntimeException]
File at "/home/sites/.composer/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php" could not be parsed as PHP, it may be binary or corrupted
The server has two PHP versions installed, 5.5.38 and 7.3.16. I'm currently running it with the newest version using the command path/to/php73 ./composer.phar global require laravel/installer
I already deleted all files, cleaned up cache, added aliases to both and even tried to install laravel directly via composer, but I got a similar error, but in other files.
I searched in lots of places but it seems like no one had this error.
I hope you guys can help me.
Regards!

Pyrus problems on Ubuntu 12 installing ZF2

I tried to install zend framework 2 on Ubuntu 12.04.1 64 bit but have run into difficulties.
# sudo pyrus install zf2/Zend_Framework-beta#Standard
failed mid transaction with no other previous errors that I can recall other than warnings about timezone not being set. ( Unfortuantely my terminal history has lost the original output)
Pyrus\Installer\Exception: Installation failed
Pyrus\AtomicFileTransaction\MultiException: ERROR: commit failed
Pyrus\IOException: CRITICAL - unable to complete transaction, rename of actual to backup path failed
Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction
Now when I try to rerun
# sudo pyrus install -f zf2/Zend_Framework-beta#Standard
it fails with
Pyrus\Registry\Exception: Cannot retrieve package file object for package packages.zendframework.com/zend_framework, it is not installed
Uninstall just tells me that it's not installed.
I restored /usr/share/.old-php to /usr/share/php however I still get the same error.
Please help.
You can just try to download and unzip Zend Framework 2 archive into your project's library folder.
It looks like it's a problem with the metapackage according the Matthew. I'm having the same problem.
Error Installing full framework with Pyrus
So if I installed pyrus here: "/usr/share/pear/pyrus" , then should I create a directory "/usr/share/pear/pyrus/zf2" and download and unzip the full Zend Framework in zf2 and it should work?
thanks

Where is PHPUnit?

Resolved!
I uninstalled phpunit from pear and then reinstalled it again. I believe I was using the wrong/old/not enough sources before installing. Works like a charm!
So I'm trying to set up PEAR & PHPUnit. I was following http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard but after I installed pear I had a different directory structure in /usr/local. Regardless, I was able run the phpunit install. But now I'm lost and asking for help before I make a bigger mess :)
pear config-show says:
PEAR directory php_dir /usr/local/share/pear
And my php.ini file (and confirmed in phpinfo() says:
include_path=".:/usr/local/share/pear"
So that's good, right? But now what? I get
Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/local/share/pear')
If I try to include it in the php. And I have no idea where the binary might be to run it from the command line.
Inside /usr/local/share/pear/PHPUnit there are two directories "Extensions" and "Framework"
It sometimes happen that the install fails on PHPUnit specifically, but succeeds on the dependencies, so it only looks like the install was succesfull.
Try this when installing
pear install --force --alldeps phpunit/PHPUnit
The --force option will force the install of PHPUnit, even if all the dependencies can't be met. In my case there was a missing dependency for the dom PHP extension which blocked the installation even though the PHP_Invoker package could be used instead.
The --alldeps option makes sure that all of the dependencies got installed.
Check for a bin directory in the pear install, something along the lines of /usr/local/share/pear/bin/ - your install is different than mine..
You could also try searching for the binary -
find /usr/local/share/pear -name 'phpunit'

PEAR/Digg2: PHP/Linux Installation Issue

I have a VPS running a VPS optimized Debian distro.
I am very new to utilizing a VPS and have next to zero Linux background.
A little background to help:
I went through and apt-get install pear which went through fine.
I attempted to install the dependent services for the Digg api as such:
pear install HTTP_Request2
This provided an error, I had to install it with:
pear install HTTP_Request2-alpha
Then I attempted:
pear install HTTP_OAuth
This provided the same error as above, I installed it eventually with:
pear install HTTP_OAuth-alpha
So I then successfully installed Digg2 with pear install Services_Digg2
Okay, background over. My issue is that it will not initiate the class as it says the file is not there. The PHP is as simple as this:
require_once 'Services/Digg2.php';
$api = new Services_Digg2;
I checked my include path as per the error in PHP:
Fatal error: require_once() [function.require]:
Failed opening required 'Services/Digg2.php' (include_path='/usr/share/php')
in /var/www/redacted1/data/www/redacted2/index.php on line 3
So I verified that the file was there in Terminal:
http://snapplr.com/tk9r
And I verified that the include path was proper via PHP_Info():
http://snapplr.com/dwk7 (sorry I can only post one hyperlink as I'm new)
The error remains.
Hopefully my lengthy intro isn't a hassle and actually helps.
Any incite?
Thanks
Jeff
To install a PEAR/PECL package that is in a state other than "stable", you have to specify the full spec for the package:
pear install Services_Digg2-alpha #alpha state
pecl install ssh2-0.11.2 #beta state
PEAR also takes care of dependencies (usually, but I can confirm in that specific case that it does). You don't have to manually install them.
Now that you have it installed, it should work like you did:
include_once 'Services/Digg2.php'
However, I'm a little concerned that your code shows include_once while the error message you have shows you are using require_once. This leads me to believe that the code you posted is not the actual code.

Categories