2014年2月3日 星期一

Install GAE for PHP on Koding (Ubuntu )

Koding.com is a cloud base development environment. All you have to do is write some awesome code and run. Don't need to waste time on installing XXXX run-time (XXX== Java, Python, Perl. PHP, MySQL). With integrated magic IDE and simple terminal. Say goodbye to 100 steps before you start coding. Koding gives you a free VM with  RAM:2.0Gb /Disk:1.2Gb (Additional resources will be purchasable from Koding in the near future.) 

1. You don't have to install MySQL, PHP, nor Python . All of them are ready out of the box in Koding.com . You only need to download GAE SDK and unzip it 
wget http://googleappengine.googlecode.com/files/google_appengine_1.8.9.zip

unzip google_appengine_1.8.9.zip


2. You can  install Python PIL if you want (you'll get warning when you run dev server locally, but it's ok anyway) by :
sudo apt-get install python-imaging 

3. Check if php-cgi is installed on your server. Mine is at /usr/bin/php-cgi . If it's not installed, follow the instruction on the tutorial


locate php-cgi 

4. Start development server locally with options:
--host 0.0.0.0 , default value is localhost. since there's no browser on your VM, you need to access your dev server from the internet.
--php_executable_path=/usr/bin/php-cgi, which specifies that using php-cgi instead of php-cli , see reason here.
google_appengine/dev_appserver.py --host 0.0.0.0 --php_executable_path=/usr/bin/php-cgi HelloGAEProject/

4. Go to <your_account>.kd.io:8080/<your_app> to test locally.

5. If you want to deploy your app to GAE, run with these option
--oauth2 , use this option to skip typing account/password
--noauth_local_webserver Don't use the web browser to display web pages for authentication. This is useful for OAuth2 authentication if you're remotely logged on or shelled into a machine. This flag only applies for OAuth2
google_appengine/appcfg.py update --oauth2 --noauth_local_webserver <your project folder name>

沒有留言:

張貼留言