Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

maf_embraceit's avatar

artisan commands not running without composer.json

We recently deployed to production environment and found out that the artisan commands are not running. running php artisan commands return below error:

In Application.php line 1399:

file_get_contents(/var/www/html/composer.json): Failed to open stream: No such file or directory

Adding composer.json fixes the issue. We never deploy composer.json to our production environments but artisan always worked. We build our deployment package by running composer install and npm run prod. Below files are deleted subsequently as they are no longer needed.

  • composer.json
  • composer.lock
  • package-lock.json
  • package.json
0 likes
2 replies
maf_embraceit's avatar

Yes, I get it, but artisan ran even without composer.json in our production environment. Secondly, the composer.json's job is finished once the vendor directory is created & autoload.php is generated. Why should artisan require it ?

Please or to participate in this conversation.