Closed Kennedy-Robert-Charles closed 3 months ago
Thanks for reporting, @Kennedy-Robert-Charles
It smells like some kind of compatibility issue.
Hypothesis 1: It looks like the error occurs early... Checker::checkRequirements()
is supposed to run before any of the real logic. Most of the files in the backtrace involve this folder:
phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/
which implies that the compatibility issue involves the box
tool. (Background: box is a build-tool. It reads civicrm/cv.git and creates the final executable copy of cv
, aka cv.phar
. civicrm-cli-tools
is just a way to distribute copies of that file.) We've been using box v4.3.8 (circa March 2023), but the latest is box v4.6.1 (circa Dec 2023).
Suggestion 1: Try this alternate build of cv
:
https://download.civicrm.org/cv/cv.phar-v0.3.48-box461
Basically, download that file. Replace the current C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar
. I don't know the equivalent BAT or PowerShell commands, but in bash the steps would be like:
cd /C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/
rm cv.phar
wget https://download.civicrm.org/cv/cv.phar-v0.3.48-box461 -O cv.phar
Then try again. (If it doesn't work, you can always delete vendor/civicrm/cli-tools
and re-run composer install
.)
Hypothesis 2: The error specifically refers to ".box/src/Terminal.php". (That file figures the #rows and #columns on the screen.) This can work a bit differently depending on OS. (And even within an OS, you might have a few different terminals -- like "Command Prompt" vs "Git bash" vs "PowerShell".) It could be a compatibility issue involving box and php83 and that specific terminal.
Suggestion 2: Try running the command in a different terminal and/or different php version.
Thanks so much for your speedy and comprehensive response @totten ! I tried your first suggestion and it worked out perfectly. It was helpful to see the bash steps to understand exactly what you were suggesting. I successfully ran the cv core:install in a Windows Command Prompt which I had opened as an administrator. And now I have just opened the CiviCRM Home page on my Drupal site. Cheers ... Rob
Great, I'm glad the recompiled version worked.
Started updates to make the newer version of box
be the default, eg
(It's not a common change... it'll take a few additional steps after those to roll-out.)
A fatal PHP error occurs during cv core:install. I provide details of the error below but first I'll provide some context.
I am exploring the possibility of using Drupal and CIVICRM to replace the donation management system currently used by a non-profit that I'm involved in.
I have PHP 8.3.3, MySQL Server 8.3 and installed on Windows 11. Drupal 10.2.3 and drush have both been installed and configured using composer.
Following the CIVICRM installation guide I first tried to get the Drupal 10 code using php ..\composer.phar require civicrm/civicrm-{core,packages,drupal-8}. However that resulted in this confusing message from composer: Pick one of these or leave empty to abort: [0] drupal/civicrm_tools I choose to abort and decided to get the CIVICRM code downloaded piece by piece in this way: 1) php composer.phar require civicrm/civicrm-core
composer's message was: Using version ^5.69 for civicrm/civicrm-core. So to keep the rest of the downloads in sync I used these restraints:
2) php composer.phar require "civicrm/civicrm-packages:^5.69" 3) php composer.phar require "civicrm/civicrm-drupal-8:^5.69" 4) php composer.phar require civicrm/cli-tools
Now when I try to do the cv core:install I get a fatal PHP error as follows: C:\drupal10\localhost>vendor\bin\cv core:install --cms-base-url="https://d10.example.org" --db="mysql://civicrm_user:civicrm_pswd@127.0.0.1:3306/civicrm_db" PHP Fatal error: Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, false given in phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/src/Terminal.php:60 Stack trace:
0 phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/src/Terminal.php(60): trim()
1 phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/src/Terminal.php(31): HumbugBox436\KevinGH\RequirementChecker\Terminal::initDimensions()
2 phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/src/Printer.php(28): HumbugBox436\KevinGH\RequirementChecker\Terminal->getWidth()
3 phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/src/Checker.php(17): HumbugBox436\KevinGH\RequirementChecker\Printer->__construct()
4 phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/bin/check-requirements.php(22): HumbugBox436\KevinGH\RequirementChecker\Checker::checkRequirements()
5 C:\drupal10\localhost\vendor\civicrm\cli-tools\extern\cv.phar(12): require('...')
6 C:\drupal10\localhost\vendor\civicrm\cli-tools\bin\cv(7): require('...')
7 C:\drupal10\localhost\vendor\bin\cv(119): include('...')
8 {main}
thrown in phar://C:/drupal10/localhost/vendor/civicrm/cli-tools/extern/cv.phar/.box/src/Terminal.php on line 60
I have tried a number of things including: a) de-installing drush (I saw reference to a conflict on stackexchange) b) using the dev-master version of cli-tools
Now I'm stumped. I would appreciate any suggestions on what I might try next. Many thanks in advance ... Rob