Andrew Fletcher published: 11 September 2023 (updated) 29 September 2023 1 minute read
Resources - changing Drush
Type | Version |
---|---|
Drush (current) | 11.6.0 |
Drush (update) | 12.2.0 |
Updating Drush went OK on all testing environments until on to the staging environment.
The initial error that I saw was
PHP Fatal error: Declaration of Drush\Style\DrushStyle::confirm($question, $default = true) must be compatible with Symfony\Component\Console\Style\SymfonyStyle::confirm(string $question, bool $default = true): bool in /var/www/html/{project}/vendor/drush/drush/src/Style/DrushStyle.php on line 11
Followed by attempting to run composer update
Your requirements could not be resolved to an installable set of packages.
Problem 1
- drush/drush[12.0.0, ..., 12.2.0] require composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint.
- Root composer.json requires drush/drush ^12 -> satisfiable by drush/drush[12.0.0, ..., 12.2.0].
To resolve this problem, update your composer by running the following command:
composer self-update
Comparing the Composer versions
Environment | Version |
---|---|
Local | 2.5.2 2023-02-04 14:33:22 |
Ubuntu server | 2.1.5 2021-07-23 10:35:47 |
Ubuntu server Composer version post running the self-update command
2.6.2 2023-09-03 14:09:15
Related articles
Andrew Fletcher
•
05 Apr 2024
Drupal 9 to 10 upgrade an example of the actual steps taken
Continuing on from the Drupal 9 to Drupal 10 upgrade outline written earlier... Upgrading Drupal 9 to Drupal 10. However, the point of difference is this article works through the actual action steps of the upgrade.Planning and testing is critical for the Drupal to version 10 process to...
Andrew Fletcher
•
03 Apr 2024
Using Drush to run SQL commands
To run a SQL command using Drush, use the following sql-query commanddrush sql-query "COMMAND"As an example, in the following I will remove all of the records in the Watchdog. Delete from watchdogTo empty (clear) the watchdog table, which contains Drupal's log messages, using the above noted...
Andrew Fletcher
•
12 Mar 2024
Drush open_basedir restriction error
Drush open_basedir restriction errorPHP Warning: include(): open_basedir restriction in effect. File(/usr/share/drush/includes/startup.inc) is not within the allowed path(s): (/var/www/vhosts/{domain}/:/tmp/) in /usr/share/drush/drush on line 113
PHP Warning: ...