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.

PHP

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 http://us2.php.net/get/php-5.4.15.tar.bz2/from/us1.php.net/mirror
  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.

SDK

You can install the PHP SDK with the following commands:

wget http://commondatastorage.googleapis.com/appengine-php/appengine-php-sdk-1.8.0.zip
  unzip appengine-php-sdk-1.8.0.zip

MySQL

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.

Next…

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!

转载请注明出处:https://www.onexin.net/installing-the-google-php-sdk-on-linux/

相关文章:

1、让 Google 在您的 AMP 网站上放置展示广告
https://www.onexin.net/google-adsense-amp/

2、如何让搜索引擎抓取AJAX内容?
https://www.onexin.net/how-to-get-search-engines-to-crawl-ajax-content/

3、谷歌向OEM厂商提供Android最大漏洞补丁
https://www.onexin.net/google-android-to-oem-manufacturers-to-provide-maximum-patches/

4、Google字典不能用了怎麼辦?
https://www.onexin.net/google-dictionary-can-not-be-how-to-do/

5、Android手机应用开发环境搭建
https://www.onexin.net/android-phone-application-development-environment-to-build/

Leave a Reply