Your software
My Mautic version is: 5.1.0
My PHP version is: 8.2
My Database type and version is: mysql 8.0.37
Your problem
My problem is: I can not automate the installation of mautic!
Im working on OpenPanel and we received requests by a few of our users to create a Mautic Manager to allow them to install and manage Mautic installations.
So I browsed Mautic documentation and based on:
- How to install Mautic manually — Mautic Developer Documentation 3.0.0 documentation
- Installation — Mautic Documentation 0.1 documentation
I manage to download mautic, extract, create db and user, edit the local.php file and run the install. Problem is in these 2 commands:
root@stefi:/home/stefan/stefi.openpanel.site# apt-get install git npm -y ; cd /home/stefan/stefi.openpanel.site && composer install --ignore-platform-req=ext-imap
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.43.0-1ubuntu7.1).
npm is already the newest version (9.2.0~ds1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
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.
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
150 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
> mautic@0.0.0 build
> webpack --mode production --config webpack.config.js
Modernizr build saved to node_modules/modernizr/modernizr-mautic-dist.js
^C
This command just gets stuck and I need to manually exit it to proceed.
root@stefi:/home/stefan/stefi.openpanel.site# php bin/console mautic:install -f https://stefi.openpanel.site
Mautic Install
==============
Parsing options and arguments...
0 - Checking installation requirements...
Missing optional settings:
- [0] Install and enable the <strong>imap</strong> extension to support monitored email.
Ready to Install!
1 - Creating database...
Errors in database configuration/installation:
[error] An error occured while attempting to connect to the database: Failed to start the session because headers have already been sent by "/home/stefan/stefi.openpanel.site/app/config/local.php" at line 1.
Install canceled
root@stefi:/home/stefan/stefi.openpanel.site# php bin/console mautic:install -f https://stefi.openpanel.site
Mautic Install
==============
Parsing options and arguments...
0 - Checking installation requirements...
Missing optional settings:
- [0] Install and enable the <strong>imap</strong> extension to support monitored email.
Ready to Install!
1 - Creating database...
1.1 - Creating schema...
1.2 - Loading fixtures...
2 - Creating admin user...
3 - Final steps...
================
Install complete
this install command when run 1st time fails, but then run again and is successful.
So to summarize, problem is that 1st command needs to be exited manually, and 2nd command needs to be run 2x.
Im not that familiar with Mautic to properly troubleshoot this, and I want to avoid workarounds to repeat commands…