Report this

What is the reason for this report?

How to change the PHP version on app platform

Posted on December 21, 2020

Hi, I am using app platform for deploying a PHP application in Laravel. How to manually tell the container which PHP version to use?



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.

šŸ‘‹šŸ¼ @tntstudio

You can configure the PHP version in composer.json like so:

{
  "require": {
    "php": "^7.2.0"
  }
}

For more details please see the PHP buildpack documentation

Thanks for the fast reply. In the meanwhile I figured out that the App platform is automatically taking my Dockerfile, which I don’t won’t because its differently configured for my local development. How can I disable this?

Hi @tntstudio,

I just noticed your second question,

If you have a Dockerfile in your repo root, it will be prioritized when creating the app via the UI. This is something we’re working on improving but here are some options in the mean time:

  1. Rename Dockerfile to e.g. Dockerfile.prod then create the app via the UI.
  2. Create the app using doctl. In your repo, run: doctl app create --spec .do/app.yaml. Since you don’t set dockerfile_path in the spec, the Dockerfile will not be used.

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.