Start Google App Engine - PHP with your own batch command (Windows)

by in 0


Google Apps engine now can run PHP
Here is hello world tutorial from Google, 
What I know is I have to run dev_appserver.py inside sdk folder and  type path to php-cgi.exe and path to the application folder.
It’s quite long for me to type whenever I want to test the app locally.
So I made a batch file inside my [appengine projects] folder and named it appstart.bat
You can save the sdk folder and php-cgi in anywhere you like, just put absolute path inside your batch file.

This is my sample batch file

E:\sandbox\appengine\sdk\dev_appserver.py --php_executable_path=C:\ProgramFilesPortable\php-5.4.20\php-cgi.exe %*
My folder structure is like
+[appengine projects]
    +helloworld
    +testproject1
    +testproject2
    -appstart.bat
So when I want to run helloworld app I just go to command prompt and type, 

e:\appengine projects>appstart helloworld

I am not sure whether or not it's best practice but as for lazy person like me, its works ok. :D
If you have any other tips please let me know also, I am just start learning GAE with PHP. 

Update
Actually I don't need to type it so many times while developing. While running the project also can edit the file. The server will auto reload if necessary as it mentioned at the helloworld example.
You can leave the web server running while you develop your application. The web server knows to watch for changes in your source files and reload them if necessary.

Leave a Reply