0
votes

I keep getting Syntax Error: unexpected character after line continuation character when I try to start the localhost server with the following command:

google_appengine\dev_appserver.py --php_executable_path="C:\Computer Science\PHP\php\php-cgi.exe" "C:\Computer Science\PHP\helloworld"

What's wrong?

My app.yaml:

application: helloworld
version: 1
runtime: php
api_version: 1

handlers:
- url: /.*
  script: helloworld.php

My helloworld.py

<?php
    echo 'Hello, World!';
?>

My directories

    /PHP
       /php
          /php-cgi.exe
       /helloworld
       /google_appengine

Edit: I have ran my app using the google app engine launcher, with php sdk and an extra command line flag in the launch settings: --php_executable_path=C:\Computer Science\PHP\php\php-cgi.exe. The server crashed.

2
Can you provide a stack trace of the error you see when you run google_appengine\dev_appserver.py --php_executable_path="C:\Computer Science\PHP\php\php-cgi.exe" "C:\Computer Science\PHP\helloworld" from the command line?Andrew J

2 Answers

1
votes

user2481064 use the windows CMD, make sure you're in the same path as your google app engine sdk, i basically put my GAE SDK and application in the same path. Here it is:

  1. Open your windows cmd, make sure you're in the same directory as your sdk.
  2. Type: "google_appengine/dev_appserver.py" --port=9999 --php_executable_path="fullpath\php-cgi.exe" "helloworld/"
  3. If you have another local server like xampp or wamp,make sure you use the --port command to select another listening port as shown above. 4.Press enter and you should have your helloworld script working.

Good luck :)

0
votes

I too got stuck with this or the other error "SyntaxError: can't assign to operator". Things got better when I stoppped using the Python shell but use the Windows cmd shell.

For my environment, the command I arrive at is

 "google_appengine\dev_appserver.py" --php_executable_path="\BitNami\rubystack-1.9.3-10\php\php-cgi.exe" "helloworld/"

(The direction of some of the slashes can be important if you later use parts of the command for separate investigation/diagnose in Windows.) Wow the engine starts despite various errors. At the webbrowser, I was able to see the localhost equivalent of the dashboard at localhost:8000/instances (force-redirected from localhost:8000) BUT the app itself at localhost:8080 (that's 8080) just shows ' "BitNami/rubystack-1.9.3-10/apache2/cgi-bin/php-cgi.exe -v" returned an error [-1072365564] '

Separately running

BitNami\rubystack-1.9.3-10\apache2\cgi-bin\php-cgi.exe -v

reports my version of PHP is 5.4.15. I am not sure if installing a an additional clean PHP will help. Or perhaps I should move on & push the app.