# Can't install mautic via composer

**URL:** https://forum.mautic.org/t/cant-install-mautic-via-composer/23781
**Category:** Mautic 4 Install/Upgrade Support
**Created:** [April 18, 2022, 8:54pm UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781 "2022-04-18T20:54:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![gabe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gabe/32/436_2.png) [@gabe](https://forum.mautic.org/u/gabe)
#### Post date: [April 18, 2022, 8:54pm UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781/1 "2022-04-18T20:54:58Z")

</div>

**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](https://github.com/mautic/mautic/issues/10957).

---

<div class="post-metadata">

### Author: ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)
#### Post date: [April 21, 2022, 5:29pm UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781/2 "2022-04-21T17:29:30Z")

</div>

Hello @gabe,

> [@gabe](#):
>
> When I’m trying to run the composer create-project command as the docs show,

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

Pierre

---

<div class="post-metadata">

### Author: ![gabe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gabe/32/436_2.png) [@gabe](https://forum.mautic.org/u/gabe)
#### Post date: [April 21, 2022, 8:46pm UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781/3 "2022-04-21T20:46:11Z")

</div>

> **[Installing with Composer](https://docs.mautic.org/en/setup/how-to-install-mautic/install-and-manage-mautic-with-composer)**
>
> How to install Mautic with Composer.

and

> **[How to switch to Composer](https://docs.mautic.org/en/setup/switch-to-composer)**
>
> . Up until Mautic 4, users could download Mautic as a ZIP file and install it on any PHP server. However, many users were running into installation and update errors, many of which caused considerable frustration and in some cases, significant...

---

<div class="post-metadata">

### Author: ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)
#### Post date: [April 21, 2022, 8:48pm UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781/4 "2022-04-21T20:48:34Z")

</div>

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](https://mautic-documentation.readthedocs.io/en/latest/getting_started/how_to_install_mautic.html#installing-with-composer)

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

Pierre

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [April 22, 2022, 7:55am UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781/5 "2022-04-22T07:55:00Z")

</div>

> [@pierre\_a](#):
>
> @silavapi Wouldn’t it be appropriate to cut out the old documentation and redirect to the new one

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

---

<div class="post-metadata">

### Author: ![gabe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gabe/32/436_2.png) [@gabe](https://forum.mautic.org/u/gabe)
#### Post date: [November 27, 2023, 6:13pm UTC](https://forum.mautic.org/t/cant-install-mautic-via-composer/23781/6 "2023-11-27T18:13:04Z")

</div>

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](https://mautic-documentation.readthedocs.io/en/latest/getting_started/switching_composer.html)

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](http://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?
