Drupal 8 - Unable to upgrade to latest version via composer - php

My current Drupal Version: 8.7.8. Want to upgrade to 8.8.0.
I already run
composer update
composer prohibits drupal/core:8.8.0
drupal/core 8.8.0 requires typo3/phar-stream-wrapper (^3.1.3)
drupal/drupal - requires typo3/phar-stream-wrapper (^2.1.1)
drupal/core 8.8.0 requires doctrine/annotations (^1.4)
drupal/drupal - does not require doctrine/annotations (but v1.2.7 is installed)
So I run
composer update drupal/core typo/* doctrine/* --with-dependencies
It gives
Package "drupal/core" listed for update is not installed. Ignoring.
Package "typo/*" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
The "http://repo.packagist.org/p/sdboyer/gliph%24a386760768df0346abad1d5c7e9e8dcf3eba1dd5aaa86a30ddc548504b0fffa0.json" file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
[Composer\Downloader\TransportException]
The "http://repo.packagist.org/p/sdboyer/gliph%24a386760768df0346abad1d5c7e9e8dcf3eba1dd5aaa86a30ddc548504b0fffa0.json" file could not be downloaded: php_network_getaddresses: geta
ddrinfo failed: nodename nor servname provided, or not known
failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
On
composer outdated drupal/*
It gives
drupal/admin_toolbar 1.27.0 2.0.0 Provides a drop-down menu interface to the core Drupal Toolbar.
So I tried
composer update "drupal/admin_toolbar:^2.0"
Package "drupal/admin_toolbar:^2.0" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package drupal/admin_toolbar (locked at 1.27.0, required as ^2.0) is satisfiable by drupal/admin_toolbar[1.27.0] but these conflict with your requirements or minimum-stability.
I also delete composer.lock file vendor folder & run the composer clearcache then composer install command.
I am not sure what is causing the issue to upgrade.

Look into your composer.json which basic requirements are set.
I think you have some very specific versions where a range would help.
Set new version(range)s explicit from command line or in json (of course save your old file). It's easier to set/update multiple versions in the file than by command line.
Also it might help to use the option --with-dependencies to update multiple packages in one run.
Then you have help with
composer update --dry-run which will tell you what will happen and with
composer why-not <packet>[:<version>] which tells you why a packet (in version ...) can't be installed.

Try deleting your /vendor folder and reinstall.
According to Help docs, there are some new issues that may pop up when upgrading by composer 8.8.0 and above.
Update core via Composer - Drupal.org

Related

Failed while installing a package using composer

iam tryin to use a cart package by using this command
composer require jason-napolitano/codeigniter4-cart-module
and it's failed. this is what it said
Using version dev-master for jason-napolitano/codeigniter4-cart-module
./composer.json has been updated
Running composer update jason-napolitano/codeigniter4-cart-module
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires jason-napolitano/codeigniter4-cart-module dev-master -> satisfiable by jason-napolitano/codeigniter4-cart-module[dev-master].
- jason-napolitano/codeigniter4-cart-module dev-master requires codeigniter4/framework ^4.0.3 -> satisfiable by codeigniter4/framework[v4.0.3, ..., v4.1.1] from composer repo (https://repo.packagist.org) but codeigniter4/framework[1.0.0+no-version-set] from root package repo has higher repository priority. The
packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
is it because my minimum-stability in composer.json is set to "stable"?
I presume you created your project by using composer create-project codeigniter4/framework. This effectively created a clean project for you without the .git folder, thus removing any metadata on what version of codeigniter4/framework package you installed. This is indicative by 1.0.0+no-version-set part of the error message.
The jason-napolitano/codeigniter4-cart-module package requires ^4.0.3 version of codeigniter4/framework, but since you have no version metadata in your project, install fails. This can be resolved by setting the version from which you bootstrapped your project manually in your root composer.json:
{
"name": "codeigniter4/framework",
"version": "4.0.3",
...
}
However, this is just a guess, since I have no insight into your main composer.json.
Your PHP is missing intl extension. It is useful for formatting currency, number and date/time as well as UCA-conformant collations, for message formatting and normalizing text..etc.
Check out Codeignitor 4 [Documentation][1]:
Follow the steps to install it in XAMPP -
Open [xampp_folder_path]/php/php.ini to edit.
Search for ;extension=intl and remove the ;.
Save the php.ini file and restart Apache.

composer cannot download mail_mime package

I am trying to download mail_mime through composer but I got this error as illustrated below.
On window command line
C:\xampp\htdocs\google>composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package pear/mail_mime dev-master exists as pear/mail_mime[1
.10.0, 1.10.1, 1.10.2, 1.8.9, 1.9.0] but these are rejected by your
constraint.
Below is a capture of my composer.json file.
So what is wrong ?
In your composer.json try changining
"pear/mail_mime":"dev-master"
to a stable release for instance 1.10.2 as shown below.
"pear/mail_mime" : "1.10.2"
You should use a specific ( tagged stable at best ) version wherever possible.
Here's more information on how versioning and constraint works in composer.

Setting up php-casperjs with composer

I'm having trouble setting up php-casperjs for my project. I've never used composer before, so I'm not exactly sure what I'm doing wrong.
I got xampp installed on Windows with php version 5.6.12
Here are the steps I completed so far.
Downloaded and installed composer. It launches successfully from the command prompt.
Downloaded php-casperjs and extracted composer.json and src/Casper.php into my project folder C:\xampp\htdocs\test
Navigated to the project folder in the command prompt and ran composer install command which installed 22 packages
Then I ran composer require phpcasperjs/phpcasperjs command and here I ran into problems. I get the following error message
Using version ^1.2 for phpcasperjs/phpcasperjs
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package phpcasperjs/phpcasperjs No version set (parsed as 1.0.0) is satisfiable by phpcasperjs/phpcasperjs[No version
set (parsed as 1.0.0)] but these conflict with your requirements or
minimum-stability.
Installation failed, reverting ./composer.json to its original
content.
When I run the following php code
use Browser\Casper;
$casper = new Casper();
I get Fatal error: Class 'Browser\Casper' not found in C:\xampp\htdocs\test\test.php on line 3
Step1: Go to you project directory and create a file "composer.json"
codes for composer.json
{
"require": {
"monolog/monolog": "1.0.*"
}
}
Note: You can create you composer.json with your required packages but i just created a simple composer.json file with monolog/monolog package. For your understanding you can follow my steps (this). You can remove the package monolog later on.
Now navigate to the project directory where composer.json file located
Run the following command:
composer require phpcasperjs/phpcasperjs
And you faced the above problem because of wrong or mismatched version of the intended package. Keep in mind that you always can create composer.json with your custom packages and their versions and which will be your package manager. For more detail about composer please visit Link

Symfony install missing vendors libraries

I have a fresh install of Symfony with everthing looking in-place apart from my vendors directory is empty? That is, it has
composer and doctrine directories in it but they are empty. If I stand in my root and run the command:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Downloading: 100%
Failed to download doctrine/lexer from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing doctrine/lexer (v1.0.1)
Cloning 83893c552fd2045dd78aef794c31e694c37c0b8c
[RuntimeException]
Failed to clone git#github.com:doctrine/lexer.git via git, https, ssh protocols, aborting.
- git://github.com/doctrine/lexer.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer'...
fatal: remote composer already exists.
- https://github.com/doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
- git#github.com:doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
At the front end browsing to http://symfony.local/web/
Warning: require(C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Fatal error: require(): Failed opening required 'C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php' (include_path='.;c:\php\includes') in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Clearly it's looking for /vendor/autoload.php but this isn't there. Why is my vendor directory empty and how can I ensure the libraries get installed?
$ composer update returns:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing paragonie/random_compat (1.1.4)
Downloading: 100%
Failed to download paragonie/random_compat from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing paragonie/random_compat (1.1.4)
Cloning d762ee5b099a29044603cd4649851e81aa66cb47
[RuntimeException]
Failed to clone git#github.com:paragonie/random_compat.git via git, https, ssh protocols, aborting.
- git://github.com/paragonie/random_compat.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat'...
fatal: remote composer already exists.
- https://github.com/paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
- git#github.com:paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
Well, your PHP is not properly configured.
Adjust your /etc/php5/php.ini and enable the "ZIP" extension.
And the rest is probably a permissions issue, because you are using Cygwin in combination with Composer. Composer and Cygwin are not really best friends.
My suggestion: run Composer on the native Windows CLI, just for the vendor fetching part.
What you want is composer update. It will read your composer.json to install all required packages. composer install is used for deployment.
Download and enable the zip extention for PHP
If you are using PHP7.0 and use a debian base distribution (Ex: Ubuntu), use the following to install and enable it automaticaly
apt-get install php-zip

Error when installing Lumen framework with Composer

When I run
sudo composer global require "laravel/lumen-installer=~1.0"
I get an error (below) that says it failed to download elfet/php-ssh.
Changed current directory to /Users/chad/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing elfet/php-ssh (v1.1.0)
Downloading: Connecting... Failed to download elfet/php-ssh from dist: The "https://api.github.com/repos/elfet/php-ssh/zipball/439becf180272542cbf154df4856a49dd3c4bf04" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
I am meeting all the server requirements too. Any ideas why it's failing to install?
It is a elfet/php-ssh package not found issue and it was resolved
Refer: https://github.com/deployphp/deployer/issues/158
Or you can install lumen via composer create-project and refer the following link has good tutorial about install lumen and create a simple rest api.
link: http://wsnippets.com/create-rest-api-using-lumen-micro-framework-by-laravel/

Categories