Error with console after upgrading to composer: path not correct

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.

1 Like

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:

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?

1 Like

i change path and get:

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

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