on App Engine
by
Luis Atencio
7/10/13
• Intro
– Overview
– Match made in heaven
– What this means for PHP developers
– Environment
– Drawbacks
– Installation
– ...
• It is a platform for developing web applications hosted on Google managed
data centers
• Scalable, distributed, elastic ...
• PHP inherently scalable
• Thread-safe
• Stateless
• PHP allows you to code (prototype) rapidly
• App Engine allows you t...
• For Java developers since 2008
• Proven, reliable, and super scalable infrastructure
• Same infrastructure that Google u...
PHP allows you to code rapidly,
App Engine allows you to deploy
rapidly
Note: you can provide your own php.ini and overwrite certain values
PHP 5.8.4 runtime
APC bcmath json gd ereg dom
date cty...
• Used extensibly in App Engine to overload communication protocols
• Allows you to use native PHP functions such as fopen...
• Python 2.7
– Used by the SDK’s runtime
• PHP 5.4.8 GGI with extensions
• App Engine PHP 1.8.1 SDK
– Contains scripts for...
• Source files [/src]
• Static resources [.css, .js, .png]
• [optional] PHP.ini file
• [required] YAML file for configurat...
Cloud StorageCloud SQL
doc
• Experimental Mode
• Out-of-the-box MySQL 5.5.31
• Automatic Backups (daily)
• Geo-located with your application
• Re...
Cloud StorageCloud SQL
doc
• Experimental Mode
• Emulation of a file system in the cloud with
automatic backups
• This is the file system your ap...
Logs Mail Memcache URL Fetch
Users Task Queues
doc
• Overridden of the syslog( ) native function
• Logs redirected to App Engine’s rolling log implementation
• Logs can ...
doc
• App Engine allows you to send mail with attachements
• Overriden the mail( ) function to be directed to their MailSe...
doc
• Uses a distributed, scalable, in-memory
caching technology
• Very effective for query caching and
object state shari...
doc
• Used to communicate with other applications or restful services
• HTTP/1.1 compliant
• Requests are made using the o...
doc
• Detect signed in Google users or any OpenID identifier
• User properties such as admin role, first name, last name, ...
doc
• Perform asynchronous, parallel work outside of the scope of the request
• Follows the “web hooks” and “unit of work”...
• PHP functions and system calls blacklisted, e.g. exec(), system()
• Access to file system is prohibited
• Direct socket ...
• You must have a Google account and request
your Google account to be whitelisted
• You need to create a GAE application ...
• With minimal configuration, WordPress runs on App Engine seamlessly
– One caveat, no dynamic updating of plugins and cor...
• https://developers.google.com/appengine/docs/php/
• http://www.youtube.com/watch?v=Qt1_atU_Qsg
• http://php-minishell.ap...
Next meeting:
South Florida PHP User Group
07/17/1013
Miami
PHP on Google App Engine
PHP on Google App Engine
PHP on Google App Engine
PHP on Google App Engine
Upcoming SlideShare
Loading in …5
×

PHP on Google App Engine

6,375 views

Published on

At Google IO this year, Google announced support for a new runtime running on App Engine, PHP. Currently, they have full support for languages such as Python, Java, and Go.

PHP on App Engine was the number one request voted by developers and Google has finally delivered. PHP empowers a great percentage of the web sites in the world, it is very likely this will be taken out of Experimental mode soon into full Production mode.

Google has taken the open source PHP 5.4 platform and augmented it to run on App Engine. They created a safe "sandboxed" environment for your apps.


A match made in heaven?

PHP is an inherent scalable language. It's thread-safe and stateless nature, makes an ideal candidate to run on scalable, elastic infrastructure. PHP allows you to code rapidly and App Engine allows you to deploy rapidly, the combination makes an incomparable development platform.

Since Google is implementing PHP 5.4, their PHP runtime has the built-in extensions for APC, OpenSSL, OAuth, among others. APC is an essential component to any PHP installation, so it's ideal that they jumped the gun and started with PHP 5.4 and 5.3.*.

What this means for PHP developers?

For a number of years now (since 2008), Java developers have enjoyed and exploited the power of Google's cloud to create their own applications. This is the same infrastructure that Google uses to contain their own applications and tools, so it's proven to be super scalable and reliable. App Engine falls into the category of Platform-As-A-Service (PaaS) that, coupled with great tools, endows your development environment with great agility. Now, PHP developers can take advantage of this.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,375
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
37
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Blogs: http://wp.ctxsblogs.appspot.com/
  • PHP on Google App Engine

    1. 1. on App Engine by Luis Atencio 7/10/13
    2. 2. • Intro – Overview – Match made in heaven – What this means for PHP developers – Environment – Drawbacks – Installation – Project Structure • Storage • Services • Demos
    3. 3. • It is a platform for developing web applications hosted on Google managed data centers • Scalable, distributed, elastic PaaS • PHP support was announced at Google IO 2013 • Limited Preview • Most voted App Engine ticket by developers • Alternatives: – Create a new JVM language – Use Caucho Quercus – Implement and extend the Open Source PHP core
    4. 4. • PHP inherently scalable • Thread-safe • Stateless • PHP allows you to code (prototype) rapidly • App Engine allows you to deploy rapidly • Google’s PHP CGI has support for APC cache, OpenSSL, OAuth, Memcache, and many more extensions
    5. 5. • For Java developers since 2008 • Proven, reliable, and super scalable infrastructure • Same infrastructure that Google uses for their own apps • Another PaaS in the market (CloudFoundary, Heroku, etc) • Cloud SQL (MySQL) • PHPStorm support for GAE
    6. 6. PHP allows you to code rapidly, App Engine allows you to deploy rapidly
    7. 7. Note: you can provide your own php.ini and overwrite certain values PHP 5.8.4 runtime APC bcmath json gd ereg dom date ctype functions PDO mcrypt openSSL SOAP SPL memcache memcached gcs simplexml url_fetch
    8. 8. • Used extensibly in App Engine to overload communication protocols • Allows you to use native PHP functions such as fopen( ) and fread( ) • Built in with App Engine: Protocol Description http URL Fetch Service https:// Secure URL Fetch Service gs:// Read/write GCS
    9. 9. • Python 2.7 – Used by the SDK’s runtime • PHP 5.4.8 GGI with extensions • App Engine PHP 1.8.1 SDK – Contains scripts for running a local version of GAE (dev_appserver.py) – Contains scripts for managing your instances in production (appcfy.py) • MySQL 5.5
    10. 10. • Source files [/src] • Static resources [.css, .js, .png] • [optional] PHP.ini file • [required] YAML file for configuration management – YAML Ain’t Markup Language – Alternative to configuration management for App Engine (appengine-web.xml, queue.xml, cron.xml) – Human friendly data serialization standard for programming languages • Basic Usage: – http://en.wikipedia.org/wiki/YAML#Language_elements
    11. 11. Cloud StorageCloud SQL
    12. 12. doc • Experimental Mode • Out-of-the-box MySQL 5.5.31 • Automatic Backups (daily) • Geo-located with your application • Replicated across datacenters
    13. 13. Cloud StorageCloud SQL
    14. 14. doc • Experimental Mode • Emulation of a file system in the cloud with automatic backups • This is the file system your application will interact with • With built in stream wrappers, access is seamless
    15. 15. Logs Mail Memcache URL Fetch Users Task Queues
    16. 16. doc • Overridden of the syslog( ) native function • Logs redirected to App Engine’s rolling log implementation • Logs can be configured in the admin console, and downloaded with SDK tools
    17. 17. doc • App Engine allows you to send mail with attachements • Overriden the mail( ) function to be directed to their MailService call • Configure a user in your application to send make from • In local development mode, mail( ) call prints the mail text to the logs
    18. 18. doc • Uses a distributed, scalable, in-memory caching technology • Very effective for query caching and object state sharing (up to 1 MB) • App Engine uses it for session management
    19. 19. doc • Used to communicate with other applications or restful services • HTTP/1.1 compliant • Requests are made using the overloaded stream wrappers for http and https • Use native PHP calls such as file_get_contents( ) • Response size can be up to 32MB
    20. 20. doc • Detect signed in Google users or any OpenID identifier • User properties such as admin role, first name, last name, email, nickname, etc • Specially useful if your application belongs to the Google marketplace
    21. 21. doc • Perform asynchronous, parallel work outside of the scope of the request • Follows the “web hooks” and “unit of work” patterns • App Engine allows Task queues to execute for 10 minutes • Configured via a file called queue.yaml: name, retry limits, concurrent execution limit, etc
    22. 22. • PHP functions and system calls blacklisted, e.g. exec(), system() • Access to file system is prohibited • Direct socket creation is prohibited • Support for outbound sockets disabled • Request/response cannot exceed 60 sec • You cannot stream data within a single request • Pure PHP: you cannot compile and upload your own extensions
    23. 23. • You must have a Google account and request your Google account to be whitelisted • You need to create a GAE application ID and request Google to whitelist your application here: https://gaeforphp.appspot.com/ • Using the SDK (appcfy.py) you will be able to upload and manage your instances in production • Source-to-Push deployment via Git
    24. 24. • With minimal configuration, WordPress runs on App Engine seamlessly – One caveat, no dynamic updating of plugins and core • Concrete5 and Drupal also known to run on App Engine
    25. 25. • https://developers.google.com/appengine/docs/php/ • http://www.youtube.com/watch?v=Qt1_atU_Qsg • http://php-minishell.appspot.com/ • http://stackoverflow.com/questions/tagged/google-app-engine+php • https://developers.google.com/appengine/articles/wordpress • https://moodle.org/mod/forum/discuss.php?d=228830 • https://developers.google.com/appengine/docs/php/refdocs/ • http://blog.jetbrains.com/phpstorm/2013/05/support-for-google-app-engine-php- in-phpstorm/ • http://blog.boombatower.com/drupal-google-app-engine
    26. 26. Next meeting: South Florida PHP User Group 07/17/1013 Miami

    ×