Score:0

I'm unable to run Drush v8.4.12 on PHP 8.1.6 using Bash on Windows11

in flag

I'm on the final two sites to migrate to D9 - but some D9 modules are now needing PHP 8.1 to stay on the latest upgrades. So - I've changed my server environment to use PHP 8.1 - and using XAMPP for Windows 11 - on PHP 8.1.6 - as per the Drupal.org PHP recommendation.

Only issue is - I'm now unable to use drush to update my remaining D7 sites. Has anybody got this to work on Windows 11 - using XAMPP or similar?

$   drush.php.bat ups
Command pm-updatestatus needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment [error]
to run this command.
The drush command 'ups' could not be executed.                                                                                          [error]

MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$ drush status
The filename, directory name, or volume label syntax is incorrect.

MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$ php -v
PHP 8.1.6 (cli) (built: May 11 2022 08:55:59) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies

MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$ drush.php.bat status
 PHP configuration      :  C:\xampp\php\php.ini
 PHP OS                 :  WINNT
 Drush script           :  C:/Users/perso/AppData/Roaming/Composer/vendor/bin/drush.php
 Drush version          :  8.4.12
 Drush temp directory   :  C:\Users\perso\AppData\Local\Temp
 Drush configuration    :
 Drush alias files      :


MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$   drush.php.bat ups
Command pm-updatestatus needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment [error]
to run this command.
The drush command 'ups' could not be executed.                                                                                          [error]

MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$ ls
favicon.ico  files/  modules/  settings.php  themes/

MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$ php -v
PHP 8.1.6 (cli) (built: May 11 2022 08:55:59) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies

MINGW64 /c/xampp/apache/htdocs/drupal-7/sites/mysite.com
$ drush
The filename, directory name, or volume label syntax is incorrect.

cn flag
[Drush 8 should work on PHP 8.1.](https://github.com/drush-ops/drush/issues/5196). Check the configuration-- it's possible that you are running Drush from one PHP, and the Drupal site from another. One way to fix issues like this permanently is to use a Docker-based tool like ddev or lando that gives you siloed containers per-site.
id flag
It is interesting to hear that XAMPP is still being used.
leymannx avatar
ne flag
Drop XAMPP, it's yesteryear's technology. Get [DDEV](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/) and you will get used to it really fast and never have to worry about this kind of stuff again, because DDEV simply comes with everything you need aboard. It also works nicely with D7.
No Sssweat avatar
ua flag
I haven’t used XAMPP since 2014 or 2015. You’re stuck in the Stone Age of local dev tech.
cm flag
I support the DDEV suggestions, but you could try to understand what is going on by adding the `-vvv` option.
Wayne Foster avatar
in flag
Thanks for all the pointers towards a non Windows OS for Drupal7. I had looked at VCL2 and using Ubuntu 22.04 - as this then mirrors exactly my uat and prod environment, but was put off by the speed of access from dev tools. If I utilise ddev - is this primarily for new dev sites - or can it be configured to pickup my existing D7 multisite config and databases? Essentially I need an environment that prevents unexpected code issues when live - the production setup rarely changes (and should not change in dev)- so the need for a siloed container is not so great here.
Wayne Foster avatar
in flag
I'll add the -vvv option when back at the office and report back here - I have a hunch it is something to do with file path interpretation in linux vs windows.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.