1

I have installed a latest magento version 2.4.6 on my machine. The setup is complete, but I can not able to execute most of Magento's commands.

If I do php bin/magento it gives me only below list of commands.

Available commands:
  completion
  help
  list
 admin
  admin:user:create
 app
  app:config:import
 events
  events:generate:module
 i18n
  i18n:collect-phrases
  i18n:pack
 info
  info:adminuri
  info:backups:list
  info:currency:list
  info:dependencies:show-framework
  info:dependencies:show-modules
  info:dependencies:show-modules-circular
  info:language:list
  info:timezone:list
 maintenance
  maintenance:allow-ips
  maintenance:disable
  maintenance:enable
  maintenance:status
 module
  module:config:status
  module:disable
  module:enable
  module:status
  module:uninstall
 sampledata
  sampledata:deploy
  sampledata:remove
 setup
  setup:backup
  setup:config:set
  setup:db-data:upgrade
  setup:db-schema:upgrade
  setup:db:status
  setup:di:compile
  setup:install
  setup:performance:generate-fixtures
  setup:rollback
  setup:static-content:deploy
  setup:store-config:set
  setup:uninstall
  setup:upgrade

I have tried, setting permissions, clearing var, generated, pub directories, correcting owner of the file, but the issue is still not resolved. I can execute any command from this list without any issue, but all other commands I run, throws error.

 There are no commands defined in the "cache" namespace.

3 Answers 3

2

Your setup doesn't finish properly. Please check your config.php and env.php under app/etc folder. Finding some working files to compare with your current files.

In the past, I faced missing install

'install' => [
        'date' => 'Thu, 09 Feb 2023 05:00:32 +0000'
    ]

in env.php

1

From your Magento root:

rm -Rf var/cache/*
rm -Rf generated/* (or rm -Rf var/generation/* depending on your Magento version)

Run this commands

1

Please check your env.php under app/etc folder with the help of another working setup. there was something missing that's why to occur this issue

otherwise,

Remove htdocs

rm -rf htdocs/*

and re-install the Magento setup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.