Does anyone have experience installing Drush for Drupal 7 on Opalstack?
Thanks.
Does anyone have experience installing Drush for Drupal 7 on Opalstack?
Thanks.
Apologies for the late reply!
I've got instructions to install the latest Drush & Drupal. Maybe they can be adapted to your case:
cd ~
composer create-project drupal/recommended-project mysite
cd mysite
composer require drush/drush
./vendor/bin/drush site:install
/home/shelluser/mysite/web/
as the symlink path and attach that app to your site.(I used mysite
as the Drupal install directory but you can change that to whatever you need it to be.)
Hello.
I have the next issue:
Running composer update drush/drush --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.Problem 1
- composer/installers is locked to version v1.5.0 and an update of this package was not requested.
- composer/installers v1.5.0 requires composer-plugin-api 1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 2
- wikimedia/composer-merge-plugin is locked to version v1.4.1 and an update of this package was not requested.
- wikimedia/composer-merge-plugin v1.4.1 requires composer-plugin-api 1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
josueValrob Fixed with
composer self-update --1
[valrob@opal6 admin]$ composer require drush/drush
Using version 10.3 for drush/drush
./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
- Conclusion: don't install twig/twig v1.44.2
- Conclusion: don't install twig/twig v1.44.1
- Conclusion: don't install twig/twig v1.44.0
- Conclusion: don't install twig/twig v1.43.1
- Conclusion: don't install twig/twig v1.43.0
- Conclusion: don't install twig/twig v1.42.5
- Conclusion: don't install twig/twig v1.42.4
- Conclusion: don't install twig/twig v1.42.3
- Conclusion: don't install twig/twig v1.42.2
- Conclusion: don't install twig/twig v1.42.1
- Conclusion: don't install twig/twig v1.42.0
- Conclusion: don't install twig/twig v1.41.0
- Conclusion: don't install drush/drush 10.3.6
- Conclusion: don't install drush/drush 10.3.5
- Conclusion: don't install drush/drush 10.3.4
- Conclusion: don't install drush/drush 10.3.3
- Conclusion: don't install drush/drush 10.3.2
- Conclusion: don't install drush/drush 10.3.1
- Conclusion: don't install drush/drush 10.3.0
- Conclusion: don't install drush/drush 10.4.0-rc1
- Conclusion: remove twig/twig v1.35.3
- Installation request for drush/drush 10.3 -> satisfiable by drush/drush[10.3.0, 10.3.1, 10.3.2, 10.3.3, 10.3.4, 10.3.5, 10.3.6, 10.4.0-rc1, 10.x-dev].
- Conclusion: don't install twig/twig v1.35.3
- drush/drush 10.x-dev requires chi-teck/drupal-code-generator 1.32.1 -> satisfiable by chi-teck/drupal-code-generator[1.32.1, 1.33.0, 1.33.1, 1.x-dev].
- chi-teck/drupal-code-generator 1.32.1 requires twig/twig 1.41 2.12 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v1.42.5, v1.43.0, v1.43.1, v1.44.0, v1.44.1, v1.44.2].
- chi-teck/drupal-code-generator 1.33.0 requires twig/twig 1.41 2.12 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v1.42.5, v1.43.0, v1.43.1, v1.44.0, v1.44.1, v1.44.2].
- chi-teck/drupal-code-generator 1.33.1 requires twig/twig 1.41 2.12 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v1.42.5, v1.43.0, v1.43.1, v1.44.0, v1.44.1, v1.44.2].
- chi-teck/drupal-code-generator 1.x-dev requires twig/twig 1.41 2.12 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v1.42.5, v1.43.0, v1.43.1, v1.44.0, v1.44.1, v1.44.2].
- Can only install one of: twig/twig[1.x-dev, v1.35.3].
- Can only install one of: twig/twig[2.x-dev, v1.35.3].
- Installation request for twig/twig (locked at v1.35.3, required as 1.35.0) -> satisfiable by twig/twig[v1.35.3].Installation failed, reverting ./composer.json to its original content.
managed to installed, but still not working:
[valrob@opal6 admin]$ ./vendor/bin/drush --version
Drush Commandline Tool 10.3.6
[valrob@opal6 admin]$ ./vendor/bin/drush ccIn CheckExceptionOnInvalidReferenceBehaviorPass.php line 31:
The service "config.import.commands" has a dependency on a non-existent service "extension.list.module".
cache:clear [--cache-clear [CACHE-CLEAR]] [--no-cache-clear] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--druplicon] [--notify [NOTIFY]] [--xh-link XH-LINK] [--] <command> <type> [<args>]...
josueValrob I think you've got some kind of version mismatch between some combination of PHP, Drupal, drush and/or composer.
sean FYI Drupal 7 EOL is Nov 2022.
https://www.drupal.org/psa-2020-06-24
featherbelly Thanks, post updated
How would I install drush for an existing installation of Drupal 7 (like one that was ported over from webfaction).
I have been singularly unsuccessful at installing the correct version of drush (one that is compatible with Drupal 7 (like 8.4.8).
I've mucked something up, but I'm not sure exactly how. The version of drush that runs outside of the app directory is 8.4.8 and seems a little broken. The version of drush that runs inside my app directory is 10.6.1 (not compatible with Drupal 7.
How do I fix this?
I want to run drush 8.4.8 everywhere (it's compatible with most versions of Drupal I use).
The installation instructions here are quite opaque.
Thanks in advance,
Dave
`
[kabal@opal4 rescueminute]$ composer require drush/drush:8.4.8
./composer.json has been updated
Running composer update drush/drush
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 drush/drush 8.4.8 -> satisfiable by drush/drush[8.4.8].
- drush/drush 8.4.8 requires consolidation/annotated-command 2.12.0 -> found consolidation/annotated-command[2.12.0, 2.12.1] but the package is fixed to 4.4.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[kabal@opal4 rescueminute]$
`
Cheers,
Dave
sean Installation above worked perfectly. Refuses to use the correct version.
[kabal@opal4 rescueminute]$ which drush
~/drush/vendor/bin/drush
[kabal@opal4 rescueminute]$ drush status
PHP binary : /usr/bin/php
PHP config : /etc/php.ini
PHP OS : Linux
Drush script : /home/kabal/apps/rescueminute/vendor/drush/drush/drush
Drush version : 10.6.1
Drush temp : /tmp
Drush configs : /home/kabal/apps/rescueminute/vendor/drush/drush/drush.y
ml
OK SOMETHING is working. I deleted the vendor/drush directory.
Every drush command produces the following error, but seems to succeed:
[kabal@opal4 rescueminute]$ drush up
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for 'BASH_FUNC_module'
OR
[kabal@opal4 rescueminute]$ drush status
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for 'BASH_FUNC_module'
So.... progress.
kabal that error is a bug in the version of Drush that you're using: https://github.com/drush-ops/drush/issues/2065
Some possible workarounds from that page:
unset module
in your shell environment.kabal It looks like composer is either not installed or not included in your PATH. You might need to restart your SSH terminal session after installing composer, or just use the path in the command when running it, eg.
~/bin/composer require drush/drush:8.4.8
sean after reading this, I downgraded Drush from 10 to 9 on my Drupal 8 site with PHP 7.3, it worked perfectly. Thank you!