Report this

What is the reason for this report?

Changing document root in the app platform

Posted on October 9, 2020

I’m trying to change the document root when deploying a PHP app on the app platform.

I’ve tried committing a Procfile with:

web: heroku-php-apache2 docs/

…in order to change the doc root to docs/

(as per heroku docs on the topic)

It gets picked up during the deployment but doesn’t seem to take effect when running the app.

Any tips?



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,

Adding the directory to the command like you did is the right way to set the document root. The Run Command that is set in the component settings will override any run commands that are detected during the build process. It sounds even though your updated your Procfile, the run command is still set to the old one which was picked up when you first created your app.

You can update the run command in the Components tab on the app’s control panel page.

I put Procfile with content “web: vendor/bin/heroku-php-apache2 public/” and “force rebuild and deploy” on D.O site and that’s work’s for me.

Same times, only “force rebuild and deploy” works!

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.