Creation of dynamic property Mautic\Middleware\MiddlewareBuilder::$spec

My software
My Mautic version is: mautic-5.1
My PHP version is: php-8.2.27-nts-Win32-vs16-x64
My Database type and version is: 8.0.30
WebServer: Laragon

My problem
My problem is: When I try to install mautic via composer the following messages appear for the composer update and composer install commands

These errors are showing in the log:

PS D:\laragon\www\mautic-5.1> composer update
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 mautic/core-lib ^5.0 → satisfiable by mautic/core-lib[5.0.0-dev].*
    • mautic/core-lib 5.0.0-dev requires ext-imap * → it is missing from your system. Install or enable PHP’s imap extension.*

To enable extensions, verify that they are enabled in your .ini files:

    • D:\laragon\bin\php\php-8.2.27-nts-Win32-vs16-x64\php.ini*
      You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
      Alternatively, you can run Composer with --ignore-platform-req=ext-imap to temporarily ignore these required extensions.
      PS D:\laragon\www\mautic-5.1> composer update
      Loading composer repositories with package information
      Updating dependencies
      Nothing to modify in lock file
      Writing lock file
      Installing dependencies from lock file (including require-dev)
      Nothing to install, update or remove
      Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
      Package stack/builder is abandoned, you should avoid using it. No replacement was suggested.
      Package theofidry/psysh-bundle is abandoned, you should avoid using it. No replacement was suggested.
      Package tightenco/collect is abandoned, you should avoid using it. Use illuminate/collections instead.
      Generating autoload files
      composer/package-versions-deprecated: Generating version class…
      composer/package-versions-deprecated: …done generating version class
      157 packages you are using are looking for funding.
      Use the composer fund command to find out more!
      phpstan/extension-installer: Extensions installed
      > php -r “if(file_exists(‘./.git’)&&file_exists(‘./build/hooks/pre-commit’.(PHP_OS==‘WINNT’?‘.win’:‘’))){copy(‘./build/hooks/pre-commit’.(PHP_OS==‘WINNT’?‘.win’:‘’),‘./.git/hooks/pre-commit’);} if(file_exists(‘./.git’)&&file_exists(‘./build/hooks/post-checkout’)){copy(‘./build/hooks/post-checkout’,‘./.git/hooks/post-checkout’);}”
      > php -r “if(file_exists(‘./.git/hooks/pre-commit’)&&(PHP_OS!=‘WINNT’)){chmod(‘./.git/hooks/pre-commit’,0755);} if(file_exists(‘./.git/hooks/post-checkout’)&&(PHP_OS!=‘WINNT’)){chmod(‘./.git/hooks/post-checkout’,0755);}”
      > npm ci --prefer-offline --no-audit
      npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs

> mautic@0.0.0 postinstall
> node_modules/modernizr/bin/modernizr -c modernizr-config.json -d node_modules/modernizr/modernizr-mautic-dist.js & npm run build

‘node_modules’ não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.

> mautic@0.0.0 build
> webpack --mode production --config webpack.config.js

Browserslist: caniuse-lite is outdated. Please run:

added 601 packages in 3m

75 packages are looking for funding

  • run npm fund for details*
    > npx patch-package
    patch-package 7.0.2
    Applying patches…
    at.js@1.5.4 :heavy_check_mark:
    chosen-js@1.8.7 :heavy_check_mark:
    > bin/console mautic:assets:generate
    ‘bin\console’ não é reconhecido como um comando interno
    ou externo, um programa operável ou um arquivo em lotes.
    Script bin/console mautic:assets:generate handling the generate-assets event returned with error code 1
    Script @generate-assets was called via post-update-cmd
    PS D:\laragon\www\mautic-5.1> composer install
    Installing dependencies from lock file (including require-dev)
    Verifying lock file contents can be installed on current platform.
    Nothing to install, update or remove
    Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
    Package stack/builder is abandoned, you should avoid using it. No replacement was suggested.
    Package theofidry/psysh-bundle is abandoned, you should avoid using it. No replacement was suggested.
    Package tightenco/collect is abandoned, you should avoid using it. Use illuminate/collections instead.
    Generating autoload files
    composer/package-versions-deprecated: Generating version class…
    composer/package-versions-deprecated: …done generating version class
    157 packages you are using are looking for funding.
    Use the composer fund command to find out more!
    phpstan/extension-installer: Extensions installed
    > php -r “if(file_exists(‘./.git’)&&file_exists(‘./build/hooks/pre-commit’.(PHP_OS==‘WINNT’?‘.win’:‘’))){copy(‘./build/hooks/pre-commit’.(PHP_OS==‘WINNT’?‘.win’:‘’),‘./.git/hooks/pre-commit’);} if(file_exists(‘./.git’)&&file_exists(‘./build/hooks/post-checkout’)){copy(‘./build/hooks/post-checkout’,‘./.git/hooks/post-checkout’);}”
    > php -r “if(file_exists(‘./.git/hooks/pre-commit’)&&(PHP_OS!=‘WINNT’)){chmod(‘./.git/hooks/pre-commit’,0755);} if(file_exists(‘./.git/hooks/post-checkout’)&&(PHP_OS!=‘WINNT’)){chmod(‘./.git/hooks/post-checkout’,0755);}”
    > npm ci --prefer-offline --no-audit
    npm error code EBUSY
    npm error syscall rmdir
    npm error path D:\laragon\www\mautic-5.1\node_modules\wildcard
    npm error errno -4082
    npm error EBUSY: resource busy or locked, rmdir ‘D:\laragon\www\mautic-5.1\node_modules\wildcard’
    npm error A complete log of this run can be found in: C:\Users\Erik\AppData\Local\npm-cache_logs\2025-01-11T07_12_09_300Z-debug-0.log
    Script npm ci --prefer-offline --no-audit handling the npm-ci event returned with error code -4082
    Script @npm-ci was called via post-install-cmd

My problem 2

Quando tento acessar o site pelo localhost, demora muito para carregar a página de instalação e quando carrega a tela fica presa na primeira tela

These errors are showing in the log:

[11-Jan-2025 07:28:35 UTC] PHP Deprecation - Creation of dynamic property Mautic\Middleware\MiddlewareBuilder::$specs is deprecated - in file D:\laragon\www\mautic-5.1\app\middlewares\MiddlewareBuilder.php - at line 24
[11-Jan-2025 07:28:35 UTC] PHP Deprecated: Creation of dynamic property Mautic\Middleware\MiddlewareBuilder::$specs is deprecated in D:\laragon\www\mautic-5.1\app\middlewares\MiddlewareBuilder.php on line 24

Code from MiddlewareBuilder.php

<?php

namespace Mautic\Middleware;

use Mautic\CoreBundle\Cache\MiddlewareCacheWarmer;
use Stack\StackedHttpKernel;

class MiddlewareBuilder
{

  • /***

  • * @var \AppKernel*
    
  • */*
    
  • private $app;*

  • /***

  • * @var string*
    
  • */*
    
  • private $cacheFile;*

  • public function __construct(\AppKernel $app)*

  • {*

  •    $this->app       = $app;*
    
  •    $this->cacheFile = sprintf('%s/middlewares.cache.php', $app->getCacheDir());*
    
  •    $this->specs     = new \SplPriorityQueue();*
    
  • }*

  • public function resolve(): StackedHttpKernel*

  • {*

  •    $this->loadMiddlewares();*
    
  •    $app         = $this->app;*
    
  •    $middlewares = [$app];*
    
  •    foreach ($this->specs as $spec) {*
    
  •        $app = $spec->newInstanceArgs([$app]);*
    
  •        array_unshift($middlewares, $app);*
    
  •    }*
    
  •    return new StackedHttpKernel($app, $middlewares);*
    
  • }*

  • private function loadMiddlewares(): void*

  • {*

  •    if (!$this->hasCacheFile()) {*
    
  •        $this->warmUpCacheCommand();*
    
  •    }*
    
  •    $this->loadCacheFile();*
    
  • }*

  • private function warmUpCacheCommand(): void*

  • {*

  •    $middlewareCacheWarmer = new MiddlewareCacheWarmer($this->app->getEnvironment());*
    
  •    $middlewareCacheWarmer->warmUp($this->app->getCacheDir());*
    
  • }*

  • private function hasCacheFile(): bool*

  • {*

  •    return file_exists($this->cacheFile);*
    
  • }*

  • private function loadCacheFile(): void*

  • {*

  •    /** @var array $middlewares */*
    
  •    $middlewares = include $this->cacheFile;*
    
  •    foreach ($middlewares as $middleware) {*
    
  •        $this->push($middleware);*
    
  •    }*
    
  • }*

  • private function push(string $middlewareClass): void*

  • {*

  •    try {*
    
  •        $reflection = new \ReflectionClass($middlewareClass);*
    
  •        $priority   = $reflection->getConstant('PRIORITY');*
    
  •        $this->specs->insert($reflection, $priority);*
    
  •    } catch (\ReflectionException $e) {*
    
  •        /* If there's an error getting the kernel class, it's*
    
  •         * an invalid middleware. If it's invalid, don't push*
    
  •         * it to the stack*
    
  •         */*
    
  •    }*
    
  • }*
    }

Steps I have tried to fix the problem:

I tried installing several versions of mautic from 3.0 to 6, changing php from 7.1 to 8.3 and I was unable to install any of the versions.