Question

How to set up PHP in App Platform

I’m trying to deploy a Dockerized app using App Platform. It is building and deploying succesfull, but I can’t seem to get PHP to work.

In the build and deploy logs I see no errors: the PHP container is being build, compose is installing packages etc. When visiting the site static resources are working, (e.g. css files), but PHP files are giving a white screen.

How can I solve this issue?


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.

alexdo
Site Moderator
Site Moderator badge
August 31, 2023

I personally have been mainly using the PHP Buildpack on App Platform as that takes away any complexity:

https://docs.digitalocean.com/products/app-platform/reference/buildpacks/php/

This lets you just deploy your PHP application by selecting your GitHub repository and then the Buildpack takes care of building and running your application.

Regards

KFSys
Site Moderator
Site Moderator badge
August 24, 2023

Hey @lpilon,

Check this article and see if it would help you out:

https://www.digitalocean.com/community/meetup-kits/how-to-create-php-development-environments-with-docker-compose-a-digitalocean-workshop-kit

If the PHP files are giving a white screen it might be a PHP coding error. Try to debug the PHP application in a controlled environment where you can see what PHP error it might be.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel