# Error with console after upgrading to composer: path not correct

**URL:** <https://forum.mautic.org/t/error-with-console-after-upgrading-to-composer-path-not-correct/23056>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [March 15, 2022, 11:19am UTC](https://forum.mautic.org/t/error-with-console-after-upgrading-to-composer-path-not-correct/23056 "2022-03-15T11:19:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexanderradahl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexanderradahl/32/7075_2.png) [@alexanderradahl](https://forum.mautic.org/u/alexanderradahl)\
**Post date:** [March 15, 2022, 11:19am UTC](https://forum.mautic.org/t/error-with-console-after-upgrading-to-composer-path-not-correct/23056/1 "2022-03-15T11:19:09Z")

</div>

**Your software**  
_My PHP version is_ : 7.4  
_My MySQL/MariaDB version is_ (delete as applicable): MySQL

**Updating/Installing Errors**  
_I am_ (delete as applicable): Updating  
_Upgrading/installing via_ (delete as applicable) : Command Line

_These errors are showing in the installer_ : None

_These errors are showing in the Mautic log_ : This is the error when I try to run console command:  
PHP Warning: require\_once(/home/mauticuser/webapps/mautic/bin/…/app/autoload.php): failed to open stream: No such file or directory in /home/mauticuser/webapps/mautic/bin/console on line 21  
PHP Fatal error: require\_once(): Failed opening required ‘/home/mauticuser/webapps/mautic/bin/…/app/autoload.php’ (include\_path=’.:’) in /home/mauticuser/webapps/mautic/bin/console on line 21

**Your problem**  
_My problem is_ :  
That I changed to composer and now mautic is in  
/home/mauticuser/webapps/mautic/docroot/ and it seems like mautic doesn’t understand that it needs to load the autoload.php file from /home/mauticuser/webapps/mautic/docroot/

_Steps I have tried to fix the problem_ :  
I’ve contacted server manager, but I cannot change the root directory, it’s not possible.

---

<div class="post-metadata">

**Author:** ![alexanderradahl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexanderradahl/32/7075_2.png) [@alexanderradahl](https://forum.mautic.org/u/alexanderradahl)\
**Post date:** [March 15, 2022, 11:50am UTC](https://forum.mautic.org/t/error-with-console-after-upgrading-to-composer-path-not-correct/23056/2 "2022-03-15T11:50:30Z")

</div>

This is just getting confusing. If I try to update the correct path in the console file (by writing it fully out) then I get this error:

```auto
PHP Warning: require(/home/mauticuser/webapps/mautic/docroot/vendor/autoload.php): failed to open stream: No such file or directory in /home/mauticuser/webapps/mautic/docroot/app/autoload.php on line 11
PHP Fatal error: require(): Failed opening required '/home/mauticuser/webapps/mautic/docroot/vendor/autoload.php' (include_path='.:') in /home/mauticuser/webapps/mautic/docroot/app/autoload.php on line 11

```

Is there some documentation missing for how you should update the directory? Or is something done wrong during upgrade to composer?

---

<div class="post-metadata">

**Author:** ![zaharovrd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zaharovrd/32/7799_2.png) [@zaharovrd](https://forum.mautic.org/u/zaharovrd)\
**Post date:** [April 6, 2022, 4:23pm UTC](https://forum.mautic.org/t/error-with-console-after-upgrading-to-composer-path-not-correct/23056/3 "2022-04-06T16:23:18Z")

</div>

i change path and get:

> There are no commands defined in the “clear” namespace.

---

<div class="post-metadata">

**Author:** ![emrl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/emrl/32/7000_2.png) [@emrl](https://forum.mautic.org/u/emrl)\
**Post date:** [May 10, 2022, 7:13pm UTC](https://forum.mautic.org/t/error-with-console-after-upgrading-to-composer-path-not-correct/23056/4 "2022-05-10T19:13:03Z")

</div>

Also experiencing this issue. How do you use the CLI with a Composer install?
