Can't install mautic via composer

Your software
My PHP version is : 7.4

Updating/Installing Errors
I am: Updating
Upgrading/installing via: Command Line

These errors are showing in the installer : /home/ubuntu/.cache/composer/vcs does not exist and could not be created.

These errors are showing in the Mautic log :

Your problem
My problem is : I’m trying to switch my installation to composer. Everything is working just fine on the existing install that is not on cmposer. When I’m trying to run the composer create-project command as the docs show, I get a composer error that says mkdir(): Permission denied when I’m running as the ubuntu user. I assume that I should run everything as www-data since that is the user that will be utilizing the installed files. So when I run the same command with sudo -su www-data prepended to it, I get an error message from composer that says /home/ubuntu/.cache/composer/vcs does not exist and could not be created.

Which user should be running the composer create-project command?

When I run as root, the install completes but that seems like poor form… If it’s run as www-data, how do I get past the error with the composer cache directory not existing?

Since I can’t get this working I’m sticking to my regular old install. Luckily that was easy to bring back online. Looks like composer-based installs aren’t working at all right now because of this bug: bin/console script must be update to work with composer install · Issue #10957 · mautic/mautic · GitHub.

Hello @gabe,

Can you specify which documentations you are following (URL) for your installation via Composer please?

Pierre

and

Hello @gabe,

I think this is an old version of the documentation and may not be up to date.
Can you try with this page ? How to install Mautic — Mautic Documentation 0.1 documentation

@rcheesley Wouldn’t it be appropriate to cut out the old documentation and redirect to the new one?

Pierre

Not at all. It’s still a work in progress and largely incomplete.

1 Like

I just trying this again using Mautic 4.4.10. I follow the instructions exactly as shown in How to switch to Composer — Mautic Documentation 0.1 documentation

But once I switch my nginx over to /var/www/html/docroot I get this error in the nginx error log:

2023/11/27 18:05:26 [error] 7828#7828: *16 FastCGI sent in stderr: “PHP message: PHP Warning - include(/var/www/html/app/config/paths_helper.php): failed to open stream: No such file or directory - in file /var/www/html/docroot/app/bundles/CoreBundle/Helper/PathsHelper.php - at line 80PHP message: PHP Warning: include(/var/www/html/app/config/paths_helper.php): failed to open stream: No such file or directory in /var/www/html/docroot/app/bundles/CoreBundle/Helper/PathsHelper.php on line 80PHP message: PHP Warning - include(): Failed opening ‘/var/www/html/app/config/paths_helper.php’ for inclusion (include_path=‘.:/usr/share/php’) - in file /var/www/html/docroot/app/bundles/CoreBundle/Helper/PathsHelper.php - at line 80PHP message: PHP Warning: include(): Failed opening ‘/var/www/html/app/config/paths_helper.php’ for inclusion (include_path=‘.:/usr/share/php’) in /var/www/html/docroot/app/bundles/CoreBundle/Helper/PathsHelper.php on line 80PHP message: PHP Notice: Undefined variable: inline in /var/www/html/docroot/offline.php on line 77” while reading response header from upstream, client: 172.31.47.54, server: marketing.incentfit.com, request: “GET /s/login HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.4-fpm.sock:”, host: “172.31.36.50”

It appears that the codebase itself in docroot/app/bundles/CoreBundle/Helper/PathsHelper.php is not using the docroot subdirectory properly?