Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run composer install --dev on Heroku?

How can I override default Heroku behavior about dependencies installation with Composer? AFAIK Heroku executes composer install --no-dev by default which is perfect for prod, but what if I intend to deploy PHP application in dev environment on the Heroku server?

So I need somehow to load dependencies from require-dev section of composer.json. Is it possible? Are there any hooks, events, etc. that could help me with it?

like image 669
Victor Bocharsky Avatar asked Nov 11 '16 11:11

Victor Bocharsky


People also ask

Does heroku allow PHP?

Heroku's PHP support extends to applications using the latest available releases in the PHP 7.4, PHP 8.0 and PHP 8.1 series.

What is composer install -- no Dev?

You can pass the --no-dev flag to the install/update commands to tell Composer that you do not want to install the development dependencies (this will also not do dev-autoload autoloading, as we will see). When deploying in production, the command to use is composer install --no-dev .


1 Answers

Access heroku shell with command heroku run bash --app=app-dev in terminal

So, update composer components with composer update --dev

like image 101
Phelipe Rocha Avatar answered Sep 23 '22 13:09

Phelipe Rocha