I'm working on a PHP app in Google App Engine. I set the document_root to "public" in the yaml, but it's ignored by the server when I deploy the app.
This is my directory structure:
app engine:/
- public
- good.php
- index.php
- app.yaml
- bad.php
- php.ini
And this is the contect of my app.yaml:
runtime: php55
api_version: 1
threadsafe: true
runtime_config:
document_root: public
handlers:
- url: /(.+\.php)$
script: \1
- url: /.*
script: index.php
What I expect to happen:
- When I browse https://mysiteurl, it loads the content of index.php.
- When I browse https://mysiteurl/bad.php, it shows the content of index.php (because it should not have access to the root app directory).
- When I browse https://mysiteurl/good.php, it shows the content of good.php
What actually happens:
- When I browse https://mysiteurl, it loads a blank page.
- When I browse https://mysiteurl/bad.php, it shows the content of bad.php.
- When I browse https://mysiteurl/good.php, it shows a blank page
How can I fix this? Am I missing something? Is something wrong with my document_root declaration in the yaml file?