Report this

What is the reason for this report?

App Platform Composer Install With Dev

Posted on March 15, 2021

In App Platform for PHP Environment. How do i force the composer install to install the packages including dev?

Currently it looks like the installing dependencies process only installed the packages for prod and no dev. I tried to use build_command: composer install --dev in app spec.yml but no luck/still error.

As with Symfony Framework, there are “post-install-cmd” scripts where it’s executed after package installed and since the env are dev. It expected if the application have installed the package in “require-dev” part.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi, Personally I found more convenient to drop a Dockerfile into the root folder of the git repository and DO will build it for you. This is worked for me better.

Hi,

Usually, the recommendation is that if a dependency is needed to build the app for production, then it should be a regular dependency and not a dev dependency.

However, if you really want to, you can configure the build to install dev dependencies. I must say that this is not officially supported so there are no guarantees that this method will work forever. To install dev dependencies, add an environment variable called HEROKU_PHP_INSTALL_DEV with no value. Leave the value text field empty. This is very important otherwise it might break the build.

Again, I would recommend doing this only for testing. If it fixes the issue then I would recommend updating your composer.json and moving the necessary dependencies from require-dev to require (and removing the workaround).

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.