Installing the Google PHP SDK on Linux

Installing the App Engine SDK for PHP on Linux

The SDK includes software for a web server that you can run on your own computer to test your PHP applications. It also includes software to upload your application to App Engine when you are done testing it locally.

In order to use the App Engine PHP SDK on your Linux-based computer, you must install the following software:

Installing Python 2.7

You will need Python 2.7 to use the App Engine PHP SDK. Fortunately, it is installed by default on most Linux systems. You can verify your Python installation using the following command:

/usr/bin/env python -V

If the output looks like Python 2.7.<number> then you already have the correct Python version installed. Otherwise you will have have to look at the installation instructions for your Linux distribution.


The PHP SDK requires version 5.4 of the php-cgi binary.

PHP 5.4 is not packaged on most Linux distributions so it may be easiest to install it from source. On Debian-based Linux systems, you can use the following commands to install PHP 5.4 in such a way that it won’t effect any other versions of PHP that you may have installed:

sudo apt-get install gcc libmysqlclient-dev libxml2-dev
  wget --trust-server-names
  bunzip2 php-5.4.15.tar.bz2
  tar -xf php-5.4.15.tar
  cd  php-5.4.15
  ./configure --prefix=$PWD/installdir --enable-bcmath --with-mysql
  make install

At this point php-cgi (the binary used by the PHP SDK) can be found in $PWD/installdir/bin/php-cgi.


You can install the PHP SDK with the following commands:



Google Cloud SQL is a MySQL database that lives in Google’s cloud. Google Cloud SQL is used by the App Engine PHP applications to permanently store their data.

In order to test your application locally, you must install MySQL on your computer. On Debian-based Linux systems, you can use the following command:

sudo apt-get install get mysql-server-5.5

You will be prompted to enter a password for the MySQL root user, make sure that you remember it.


The PHP SDK includes a local development environment that lets you develop and test complete App Engine applications before showing them to the world. Let’s write some code.

Continue to Hello, World!



1、让 Google 在您的 AMP 网站上放置展示广告





Leave a Reply