Changing document root in the app platform

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?


Submit an 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.


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.