Question

How to change the PHP version on app platform

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


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

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?

👋🏼 @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