Deploy google app engine :

Deploy php script aka application to google app engine is interesting. I came from traditional ftp-ing (so 1999 hehehe), scp and cpanel. Google app engine provide 2 ways of deployment; through and via git. I’ll try to explore both options now.


In this stage, application need to get register first to App Engine Administration Console. Visit this address to get it done :


Choose google account to use for this purpose.


click “Create Application” button.


make sure to check name availability and quota application (max 10).


Google app engine will need grant access from your google account.


Click ‘Accept” button to get started.


Deployment using

$ google_appengine/ –oauth2 update digitalfusi/

08:59 PM Application: difuphp; version: 1
08:59 PM Host:
08:59 PM
Starting update of app: difuphp, version: 1
08:59 PM Getting current resource limits.
Your browser has been opened to visit:

If your browser is on a different machine then exit and re-run this
application with the command-line parameter


(process:3287): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0′ failed
Authentication successful.
09:01 PM Scanning files on local disk.
09:01 PM Cloning 2 application files.
09:01 PM Uploading 2 files and blobs.
09:01 PM Uploaded 2 files and blobs
09:01 PM Compilation starting.
09:01 PM Compilation completed.
09:01 PM Starting deployment.
09:01 PM Checking if deployment succeeded.
09:01 PM Deployment successful.
09:01 PM Checking if updated app version is serving.
09:01 PM Completed update of app: difuphp, version: 1

Testing the result by visit

Selection_013 is very straightforward command. Combine with oauth option I can upload all my php script to google infrastructure. Awesome.


Testing php script on google app engine

On last post I’ve wrote about howto install the google app SDK for PHP . Today I want to continue with simple testing.

How to run php script using google app engine on my Ubuntu 13.04 desktop :

1. Setting PATH to google app engine by edit .profile

$ cd
$ nano .profile

add this line :



2. Export the PATH for current operation

$ export PATH=”$HOME/google_appengine:$PATH”
$ echo $PATH


3. Create testing directory

$ mkdir digitalfusi

4. Create php script

$ nano digitalfusi/index.php

put these lines :


echo “Hello world from <p>”;




5. Create yaml file (configuration file).

$ nano digitalfusi/app.yaml

Put these lines :

application: digitalfusi
version: 1
runtime: php
api_version: 1

– url: /.*
script: index.php

save. For full list of yaml option you can refer to this link.

6. Run the script

Google app engine need to know which php-cgi that work.

if you use php-cgi from ubuntu stock you can run the server using this command :

$ google_appengine/ –php_executable_path=/usr/bin/php-cgi digitalfusi

INFO     2013-11-23 06:50:46,610] Checking for updates to the SDK.
INFO     2013-11-23 06:50:59,891] Update check failed: HTTP Error 404: Not Found
INFO     2013-11-23 06:50:59,927] Starting API server at: http://localhost:39378
INFO     2013-11-23 06:50:59,951] Starting module “default” running at: http://localhost:8080
INFO     2013-11-23 06:50:59,961] Starting admin server at: http://localhost:8000


Using previous location of php-cgi :

$ google_appengine/ –php_executable_path=$HOME/php-5.4.22/installdir/bin/php-cgi digitalfusi

INFO     2013-11-23 06:47:20,067] Checking for updates to the SDK.
INFO     2013-11-23 06:47:27,422] Update check failed: HTTP Error 404: Not Found
INFO     2013-11-23 06:47:27,452] Starting API server at: http://localhost:46100
INFO     2013-11-23 06:47:27,477] Starting module “default” running at: http://localhost:8080
INFO     2013-11-23 06:47:27,482] Starting admin server at: http://localhost:8000


install php sdk for google app engine on ubuntu 13.04

Another need for try php on google app engine make install all required stuff :

Install python

$ sudo apt-get install python

Check version :

$ python -V
Python 2.7.4

Install PHP CGI

Download latest php 5.4 from download page :

$ wget -c -O php-5.4.22.tar.gz

$ tar xvzf php-5.4.22.tar.gz

$ cd php-5.4.22/

$ sudo apt-get install gcc libmysqlclient-dev libxml2-dev

$ ./configure --prefix=$PWD/installdir --enable-bcmath --with-mysql

$ make install

Check version :

$ pwd


using absolute path

$ /home/alamsyah/php-5.4.22/installdir/bin/php-cgi -v

PHP 5.4.22 (cgi-fcgi) (built: Nov 23 2013 11:22:27)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Google APP engine SDK for PHP

Download latest version from here.

$ cd

$ wget -c

$ unzip

MySQL Server

$ sudo apt-get install mysql-server-5.5 mysql-client-5.5

check :

$ dpkg -l | grep mysql

ii  libdbd-mysql-perl                         4.021-1                                i386         Perl5 database interface to the MySQL database
ii  libmysqlclient-dev                        5.5.34-0ubuntu0.13.04.1                i386         MySQL database development files
ii  libmysqlclient18:i386                     5.5.34-0ubuntu0.13.04.1                i386         MySQL database client library
ii  mysql-client-5.5                          5.5.34-0ubuntu0.13.04.1                i386         MySQL database client binaries
ii  mysql-client-core-5.5                     5.5.34-0ubuntu0.13.04.1                i386         MySQL database core client binaries
ii  mysql-common                              5.5.34-0ubuntu0.13.04.1                all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server-5.5                          5.5.34-0ubuntu0.13.04.1                i386         MySQL database server binaries and system database setup
ii  mysql-server-core-5.5                     5.5.34-0ubuntu0.13.04.1                i386         MySQL database server binaries

Great, client and server installed.

At this stage all requirement has installed correctly. I need php editor and I choose sublime text 2.

Install Sublime Text 2

$sudo add-apt-repository ppa:webupd8team/sublime-text-2

$sudo apt-get update

$sudo apt-get install sublime-text

Selection_005 vs

As copy paste user I never realized the difference between that address


Yes, old-release hold old version ubuntu that not supported any longer. I see that when I need to install php5-curl on Maverick and I get 404 message.

Change sources.list entry from to give me php5-curl :-)

# apt-get install php5-curl
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libfreeradius2 freeradius-common freeradius-utils libperl5.10
Use ‘apt-get autoremove’ to remove them.
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 125 not upgraded.
Need to get 25.5kB of archives.
After this operation, 127kB of additional disk space will be used.
Install these packages without verification [y/N]? y

Check install :

# dpkg -l | grep curl
ii  libcurl3                        7.21.0-1ubuntu1                   Multi-protocol file transfer library (OpenSSL)
ii  libcurl3-gnutls                 7.21.0-1ubuntu1                   Multi-protocol file transfer library (GnuTLS)
ii  php5-curl                       5.2.10.dfsg.1-2ubuntu6            CURL module for php5

don’t forget to restart apache to get into business.

Installing Android SDK on Ubuntu Desktop 13.04

I want to learn about Android application and heard about phonegap. Android SDK is a must have before proceed to next step. Here my documentation for install android SDK on my Ubuntu Desktop 13.04 :

Get latest SDK Tools, minimalist is better. I pick SDK Tools only.

After get the link via firefox I decide to use wget :

$ wget -c
$ mv android-sdk_r22.3-linux.tgz /home/alamsyah/
$ cd /home/alamsyah/
$ tar xvzf android-sdk_r22.3-linux.tgz

update path ::

$ export PATH="$HOME/android-sdk-linux/tools:$HOME/android-sdk-linux/platforms:$PATH"

$ echo $PATH


install jdk and  ant

$ sudo apt-get install openjdk-6-jdk ant


Click Install 9 Packages button to continue and get rid of “missing platform tools” error message.


After install remaining packages then the path need to adjust :

Last one need to install related to Android SDK is : android debug bridge
$ sudo apt-get install android-tools-adb

Enough :-)