Stinky Stinky - 2 months ago 17
PHP Question

PHP Goole App Engine can't open _ah/start locally

I'm running Google App Engine locally with a PHP app, which started fine before this morning. I created a dir and a file, then tried to start the app and got the below error. Deleting the dir and file doesn't help. I tried an

gcloud components update
, which updated my local SDK, but I still get the error.

ERROR:root:php failure (255) with:
stdout:
X-Powered-By: PHP/5.5.26
Content-type: text/html



Warning: chdir(): Invalid argument (errno 22) in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 70



Warning: require(/Users/daddy/WebstormProjects/old-php-dev/new/_ah/start): failed to open stream: No such file or directory in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 147



Fatal error: require(): Failed opening required '/Users/daddy/WebstormProjects/old-php-dev/new/_ah/start' (include_path='.:/Users/daddy/WebstormProjects/old-php-dev/new:/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/php/sdk') in /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/php/setup.php on line 147


INFO 2016-09-28 13:38:15,042 module.py:788] default: "GET /_ah/start HTTP/1.1" 500 1163

EDIT

app.yaml

application: old-php-dev
version: 1
runtime: php55
api_version: 1
threadsafe: yes
instance_class: B1
manual_scaling:
instances: 1

beta_settings:
cloud_sql_instances: "old-php-dev:us-central1:old-php-prod"

handlers:
- url: /(.*\.(htm$|html$|css$|js$|pdf$))
static_files: \1

upload: (.*\.(htm$|html$|css$|js$|pdf$))
application_readable: true

- url: /(.*\.(ico$|jpg$|png$|gif$|woff$|ttf$))
static_files: \1

upload: (.*\.(ico$|jpg$|png$|gif$|woff$|ttf$))
application_readable: true

- url: /member/(.+)
script: member/\1

- url: /member/.*
script: member/index.php

- url: /(.+)
script: \1

- url: /.*
script: index.php

Answer

Rework this:

- url: /(.+)
  script: \1

It is intercepting your call to /_ah/start

Perhaps the simplest way is to add a handler ABOVE it in app.yaml:

- url: /_ah/.*
  script: index.php 

And add a simple function to return an empty string when a request goes to that start url.