Question

App Platform: No matching DirectoryIndex

I’ve setup a new App to host my Symfony project. The app has built fine and files are located in /workspace/ but when trying to access the app I receive a 403 and logs show Cannot serve directory /workspace/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive.

I believe this is because the index.php for Symfony is within /workspace/public/ but I cannot see how to update the config for this, I also can’t see a way to gain root access to look further into the configuration.

How would I resolve this?


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.

Bobby Iliev
Site Moderator
Site Moderator badge
March 19, 2023

Hi there,

Indeed the DigitalOcean App Platform does not come with root access, if you want to have root access you could go with a Droplet instead:

https://www.digitalocean.com/products/droplets

Regarding the issue that you are seeing, I believe that you should be able to update your App Platform run the command heroku-php-apache2 public/ so that the web server itself will be started with the correct document root.

Here is an example PHP project that you could reference:

https://github.com/thedevdojo/wave/blob/main/.do/deploy.template.yaml

It is based on Laravel but the approach should be similar.

Let me know how it goes!

Best,

Bobby

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