Your software
My PHP version is : PHP 8.1.27
My MySQL/MariaDB version is: 10.6.12-MariaDB
Updating/Installing Errors
I’m Updating my server from Mautic 4.x to 5.0.1 via Command Line
These errors are showing in the installer :
On the terminal after running composer update
I got:
$ composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
Generating autoload files
117 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Deprecation Notice: Return type of Mautic\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/mautic/vendor/mautic/core-composer-scaffold/Operations/ScaffoldFileCollection.php:118
> npm ci --prefer-offline --no-audit
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
> 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
Modernizr build saved to node_modules/modernizr/modernizr-mautic-dist.js
> mautic@0.0.0 build
> webpack --mode production --config webpack.config.js
[CKEditorTranslationsPlugin] Error: No translation has been found for the en language.
asset ckeditor.js 1.23 MiB [emitted] [minimized] [big] (name: main) 2 related assets
cached modules 9.82 MiB (javascript) 919 bytes (runtime) [cached] 1616 modules
webpack 5.88.2 compiled successfully in 26561 ms
added 597 packages in 56s
73 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 ✔
You made a reference to a non-existent script @generate-assets
No security vulnerability advisories found
$
After that,I went to the browser saw the following message:
The "app/bundles/CoreBundle/Resources/views/Offline" directory does not exist ("//app/bundles/CoreBundle/Resources/views/Offline").
Also, I notice that the URL on the browser is https://server.com/index.php/installer
To “complete” the update from version 4 to 5, I had to basically make a brand new Mautic 5 with composer and then copy the composer.json
file.
Here is how my composer.json
look before I ran the update:
(its not 100% exact as the one Mautic5 generates but almost identical)
{
"name": "mautic/recommended-project",
"description": "Project template for Mautic 4 projects with composer",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.mautic.org/mautic-releases",
"support": {
"user-docs": "https://docs.mautic.org/en",
"developer-docs": "https://developer.mautic.org",
"chat": "https://www.mautic.org/slack"
},
"funding": [
{
"type": "other",
"url": "https://opencollective.com/mautic"
},
{
"type": "other",
"url": "https://github.com/sponsors/mautic"
}
],
"authors": [
{
"name": "",
"role": ""
}
],
"require": {
"composer/installers": "^1.11",
"mautic/core-composer-scaffold": "4.x-dev",
"mautic/core-lib": "5.0.1",
"mautic/core-project-message": "4.x-dev",
"mautic/grapes-js-builder-bundle": "5.0.1",
"mautic/plugin-clearbit": "5.0.1",
"mautic/plugin-cloudstorage": "5.0.1",
"mautic/plugin-crm": "5.0.1",
"mautic/plugin-emailmarketing": "5.0.1",
"mautic/plugin-focus": "5.0.1",
"mautic/plugin-fullcontact": "5.0.1",
"mautic/plugin-gmail": "5.0.1",
"mautic/plugin-outlook": "5.0.1",
"mautic/plugin-social": "5.0.1",
"mautic/plugin-tagmanager": "5.0.1",
"mautic/plugin-zapier": "5.0.1",
"mautic/theme-aurora": "5.0.1",
"mautic/theme-blank": "5.0.1",
"mautic/theme-brienz": "5.0.1",
"mautic/theme-cards": "5.0.1",
"mautic/theme-coffee": "5.0.1",
"mautic/theme-confirmme": "5.0.1",
"mautic/theme-fresh-center": "5.0.1",
"mautic/theme-fresh-fixed": "5.0.1",
"mautic/theme-fresh-left": "5.0.1",
"mautic/theme-fresh-wide": "5.0.1",
"mautic/theme-goldstar": "5.0.1",
"mautic/theme-mauve": "5.0.1",
"mautic/theme-nature": "5.0.1",
"mautic/theme-neopolitan": "5.0.1",
"mautic/theme-oxygen": "5.0.1",
"mautic/theme-paprika": "5.0.1",
"mautic/theme-skyline": "5.0.1",
"mautic/theme-sparse": "5.0.1",
"mautic/theme-sunday": "5.0.1",
"mautic/theme-trulypersonal": "5.0.1",
"mautic/theme-vibrant": "5.0.1",
"php-http/message-factory": "^1.1",
"phpoffice/phpspreadsheet": "1.24.0"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/mautic/FOSOAuthServerBundle.git"
},
{
"type": "git",
"url": "https://github.com/mautic/SpBundle.git"
},
{
"type": "git",
"url": "https://github.com/mautic/SymfonyBridgeBundle.git"
}
],
"conflict": {
"mautic/mautic": "*",
"mautic/core": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"symfony/flex": true,
"mautic/core-composer-scaffold": true,
"mautic/core-project-message": true,
"php-http/discovery": true
}
},
"autoload": {
"psr-4": {
"MauticPlugin\\": "docroot/plugins/"
}
},
"scripts": {
"post-install-cmd": [
"@npm-ci",
"@npx-patch-package",
"@generate-assets"
],
"post-update-cmd": [
"@npm-ci",
"@npx-patch-package",
"@generate-assets"
],
"npm-ci": "npm ci --prefer-offline --no-audit",
"npx-patch-package": "npx patch-package"
},
"extra": {
"mautic-scaffold": {
"locations": {
"web-root": "docroot/"
}
},
"installer-paths": {
"docroot/app": [
"type:mautic-core"
],
"docroot/plugins/{$name}": [
"type:mautic-plugin"
],
"docroot/themes/{$name}": [
"type:mautic-theme"
]
},
"mautic-core-project-message": {
"include-keys": [
"homepage",
"support"
],
"post-create-project-cmd-message": [
"<bg=blue;fg=white> </>",
"<bg=blue;fg=white> Congratulations, you’ve installed the Mautic codebase </>",
"<bg=blue;fg=white> from the mautic/recommended-project template! </>",
"<bg=blue;fg=white> </>",
"",
"<bg=yellow;fg=black>Next steps</>:",
" * Install Mautic",
" * Read the user guide",
" * Get support: https://www.mautic.org/support",
" * Get involved with the Mautic community:",
" https://www.mautic.org/getting-involved",
" * Remove the plugin that prints this message:",
" composer remove mautic/core-project-message"
]
}
}
}
I had to remove this line from the scripts section because I was getting an error;
"generate-assets": "php bin/console mautic:assets:generate"
These errors are showing in the Mautic log :
The error on the log file /var/log/nginx/mautic.error
shows the following
2024/01/15 22:59:02 [error] 15649#15649: *185 FastCGI sent in stderr: "PHP message: PHP Fatal error: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void in /srv/mautic/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php on line 51PHP message: PHP Notice: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void - in file /srv/mautic/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php - at line 51PHP message: PHP Warning - Undefined variable $projectRoot - in file /srv/mautic/docroot/app/config/paths.php - at line 15PHP message: PHP Warning: Undefined variable $projectRoot in /srv/mautic/docroot/app/config/paths.php on line 15PHP message: Symfony\Component\ErrorHandler\Error\FatalError: Notice: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void - in file /srv/mautic/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php - at line 51" while reading response header from upstream, client: 98.143.96.201, server: server.com, request: "GET /index.php/installer HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "server.com"