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

**URL:** <https://forum.mautic.org/t/creation-of-dynamic-property-mautic-middleware-middlewarebuilder-spec/34720>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [January 11, 2025, 7:58am UTC](https://forum.mautic.org/t/creation-of-dynamic-property-mautic-middleware-middlewarebuilder-spec/34720 "2025-01-11T07:58:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peritoseminfo\_1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peritoseminfo_1/32/13292_2.png) [@peritoseminfo\_1](https://forum.mautic.org/u/peritoseminfo_1)\
**Post date:** [January 11, 2025, 7:58am UTC](https://forum.mautic.org/t/creation-of-dynamic-property-mautic-middleware-middlewarebuilder-spec/34720/1 "2025-01-11T07:58:51Z")

</div>

**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:_

- npx update-browserslist-db@latest\*
- Why you should do it regularly: [GitHub - browserslist/update-db: CLI tool to update caniuse-lite to refresh target browsers from Browserslist config](https://github.com/browserslist/update-db#readme)\*  
_[CKEditorTranslationsPlugin] Error: No translation has been found for the en language._  
_asset ckeditor.js 1.45 MiB [emitted] [minimized] [big] (name: main) 2 related assets_  
_cached modules 10.9 MiB (javascript) 2.06 KiB (runtime) [cached] 1731 modules_  
_webpack 5.88.2 compiled successfully in 34451 ms_

_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 ✔_  
_chosen-js@1.8.7 ✔_  
_\> 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.
