SlideShare a Scribd company logo
1 of 28
PHP Web Apps on Google Cloud
Bhavik Shah
Software Architect. Technologist. Evangelist.
Introduction
PaaS Clouds with PHP!
Google App Engine
Scalable, Reliable & Fast PaaS
* Experimental
PHP Support.
Why PHP?
Built for Web
Easy to Learn
Most Requested
<?php
echo "Hello World!";
?>
PHP
Frameworks
Rapid
Most popular
75% of Web is served by PHP
(as per Google)
Symbiotic relation
Google provides a great platform for PHP
PHP brings a popular language to Google.
PHP on App Engine
Image Courtesy: Google IO 2013
How to PHP?
Installation
Python 2.7
Google App Engine SDK 1.8.4
PHP (Thread Safe) 5.4
Remember:
Add each of it to your OS’s PATH variable.
URLs
http://www.python.org
https://developers.google.com/appengine/
http://php.net/downloads.php
Example installers (for Windows):
GoogleAppEngine-1.8.3.msi and php-5.4.17-Win32-VC9-x86.zip
Sign up
Google provides a great platform for PHP
PHP provides a language to Google.
Create application
Google provides a great platform for PHP
PHP provides a language to Google.
Creating application locally - 1
app.yaml
application: <your-app-id>
version: 1
runtime: php
api_version: 1
threadsafe: true
handlers:
- url: /assets
  script: assets
- url: /.*
  script: index.php
YAML
Creating application locally - 2
index.php
<?php
echo "Hello World!";
?>
PHP
Creating application locally - 3
php.ini
; php.ini
google_app_engine.enable_functions = "php_sapi_name,
php_uname, phpinfo"
INI
Creating application locally - 4
phpinfo.php
<?php
echo phpinfo();
?>
PHP
Deploying
Executing Application (Runs Locally)
dev_appserver.py --php_executable_path=
C:phpphp-cgi.exe <application id>
Update source to Google App Engine
appcfg.py update php-4-gae
Access on Google App Engine
http://<application id>.appspot.com/
Features
Cloud SQL
MySQL 5.5 in Cloud
Automatic Backups
Automatic replication
Geo-Located with App
Resource Limit
Maximum Request Size 16 MB
Maximum Response Size 16 MB
//PDO
$db = new PDO('mysql:unix_socket=/cloudsql/hello-php:my-cloudsql-instance;charset=utf8',
'<username>',
'<password>'
);
//mysql_connect
$conn = mysql_connect(":/cloudsql/hello-php:my-cloudsql-instance", "<username>",
"<password>");
//mysqli
$sql = new mysqli(null, "<username>", "<password>", null, null, "/cloudsql/hello-php:my-
cloudsql-instance");
PHP
Cloud Storage
Built in Stream Wrappers allowing use of
file api’s like file_get_contents();
$fp = fopen("gs://my_bucket/some_file.txt", "w");
fwrite($fp, "Hello");
fclose($fp);
$options = [ "gs" => [ "Content-Type" => "text/plain" ]];
$ctx = stream_context_create($options);
file_put_contents("gs://my_bucket/hello.txt", "Hello", 0, $ctx);
PHP
Functions disabled by default
Manual enabling possible via php.ini
gc_collect_cycles(), gc_enable() and gc_disable()
getmypid()
getmyuid()
getrusage()
getmyinode()
getmygid()
get_current_user()
libxml_disable_entity_loader()*
parse_str()
phpinfo()
phpversion()
PHP
Disabled Functions
Permanently disabled
disk_free_space()
diskfreespace()
escapeshellarg() and escapeshellcmd()
exec()
fsockopen()
link()
passthru()
popen(), proc_close(), prog_get_status(), proc_nice(), proc_open() and proc_terminate()
set_time_limit()
shell_exec()
show_source()
symlink()
system()
tmpfile()
tempnam()
PHP
Limits on PHP
Limit Amount
request size 32 megabytes
response size 32 megabytes
request duration 60 seconds
maximum total number of files (app files and static files) 10,000 total
1,000 per directory
maximum size of an application file 32 megabytes
maximum size of a static file 32 megabytes
maximum total size of all application and static files first 1 gigabyte is free
$0.13 per gigabyte per month after first 1 gigabyte
All database requests must finish within the HTTP request timer, around 60
seconds.
Offline requests like cron tasks have a time limit of 10 minutes.
Backend requests to Google Cloud SQL have a time limit of 10 minutes.
Other Services
Application Identity
Logs
Mail
MemCache
URL Fetch
User Authentication
Task Queues
Web App : URL Shortener
Use Bootstrap with PHP
Recommended: CodeIgnitor or Yii
Source Code available at https://github.com/bhavik1st/php-
4-gae
Web App on Google App Engine
http://php-4-gae.appspot.com/
$client = new Google_Client();
$service = new Google_UrlshortenerService($client); $taskDone = false;
if (isset($_GET['url']))
{
// Start to make API requests.
$url = new Google_Url(); $url->longUrl = $_GET['url'];
//Shorten URL
$shortUrl = $service->url->insert($url);
$taskDone = true;
}
PHP
Demo
References & Other details
developer.google.com
venturebeat.com
udemy.org
Disclaimer: All images & logos used in
the presentation are various trademarks
of respective organizations.
Other details
Code : https://github.com/bhavik1st/php-4-gae
Article: http://goo.gl/X7hbBI
Questions?
Thank you for your attention
Bhavik Shah
Twitter: bhavik1st
Email: bhavik1st@gmail.com
www.linkedin.com/in/bhavik1st

More Related Content

What's hot

GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
Nat Weerawan
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 
Simple php backdoor_by_dk
Simple php backdoor_by_dkSimple php backdoor_by_dk
Simple php backdoor_by_dk
Stan Adrian
 

What's hot (19)

GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
Drupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case StudyDrupal Performance - SerBenfiquista.com Case Study
Drupal Performance - SerBenfiquista.com Case Study
 
WP migrations
WP migrationsWP migrations
WP migrations
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
autopkgtest lightning talk
autopkgtest lightning talkautopkgtest lightning talk
autopkgtest lightning talk
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
 
Scaling up development of a modular code base
Scaling up development of a modular code baseScaling up development of a modular code base
Scaling up development of a modular code base
 
Heavy Web Optimization: Backend
Heavy Web Optimization: BackendHeavy Web Optimization: Backend
Heavy Web Optimization: Backend
 
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++SECCOM 2017 - Conan.io o gerente de pacote para C e C++
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Asynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time MessagingAsynchronous PHP and Real-time Messaging
Asynchronous PHP and Real-time Messaging
 
Perlmania_Study - CPAN
Perlmania_Study - CPANPerlmania_Study - CPAN
Perlmania_Study - CPAN
 
Configuration surgery with Augeas (OggCamp 12)
Configuration surgery with Augeas (OggCamp 12)Configuration surgery with Augeas (OggCamp 12)
Configuration surgery with Augeas (OggCamp 12)
 
Simple php backdoor_by_dk
Simple php backdoor_by_dkSimple php backdoor_by_dk
Simple php backdoor_by_dk
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
livedoor blogのsorryサーバの話 #study2study
livedoor blogのsorryサーバの話 #study2studylivedoor blogのsorryサーバの話 #study2study
livedoor blogのsorryサーバの話 #study2study
 
Mac OS X Lion で作る WordPress local 環境
Mac OS X Lion で作る WordPress local 環境Mac OS X Lion で作る WordPress local 環境
Mac OS X Lion で作る WordPress local 環境
 
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswiftmacOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
macOS アプリで Swift Package Manager を使ってみる #love_swift #hakataswift
 

Similar to GDG DevFest 2013 - PHP Web Apps on Google Cloud

3. build your own php extension ai ti aptech
3. build your own php extension   ai ti aptech3. build your own php extension   ai ti aptech
3. build your own php extension ai ti aptech
Quang Anh Le
 
07 build your-own_php_extension
07 build your-own_php_extension07 build your-own_php_extension
07 build your-own_php_extension
Nguyen Duc Phu
 
Build your own PHP extension
Build your own PHP extensionBuild your own PHP extension
Build your own PHP extension
Võ Duy Tuấn
 
build your own php extension
build your own php extensionbuild your own php extension
build your own php extension
hazzaz
 

Similar to GDG DevFest 2013 - PHP Web Apps on Google Cloud (20)

3. build your own php extension ai ti aptech
3. build your own php extension   ai ti aptech3. build your own php extension   ai ti aptech
3. build your own php extension ai ti aptech
 
07 build your-own_php_extension
07 build your-own_php_extension07 build your-own_php_extension
07 build your-own_php_extension
 
Build your own PHP extension
Build your own PHP extensionBuild your own PHP extension
Build your own PHP extension
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Deploy a PHP App on Google App Engine
Deploy a PHP App on Google App EngineDeploy a PHP App on Google App Engine
Deploy a PHP App on Google App Engine
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vuln
 
PSR-7 and PSR-15, why can't you ignore them
PSR-7 and PSR-15, why can't you ignore themPSR-7 and PSR-15, why can't you ignore them
PSR-7 and PSR-15, why can't you ignore them
 
Php
PhpPhp
Php
 
Diving into HHVM Extensions (PHPNW Conference 2015)
Diving into HHVM Extensions (PHPNW Conference 2015)Diving into HHVM Extensions (PHPNW Conference 2015)
Diving into HHVM Extensions (PHPNW Conference 2015)
 
How PHP works
How PHP works How PHP works
How PHP works
 
Hacking with hhvm
Hacking with hhvmHacking with hhvm
Hacking with hhvm
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
Day1
Day1Day1
Day1
 
Diving into HHVM Extensions (Brno PHP Conference 2015)
Diving into HHVM Extensions (Brno PHP Conference 2015)Diving into HHVM Extensions (Brno PHP Conference 2015)
Diving into HHVM Extensions (Brno PHP Conference 2015)
 
build your own php extension
build your own php extensionbuild your own php extension
build your own php extension
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

GDG DevFest 2013 - PHP Web Apps on Google Cloud

  • 1. PHP Web Apps on Google Cloud Bhavik Shah Software Architect. Technologist. Evangelist.
  • 4. Google App Engine Scalable, Reliable & Fast PaaS * Experimental PHP Support.
  • 5. Why PHP? Built for Web Easy to Learn Most Requested <?php echo "Hello World!"; ?> PHP Frameworks Rapid Most popular 75% of Web is served by PHP (as per Google)
  • 6. Symbiotic relation Google provides a great platform for PHP PHP brings a popular language to Google.
  • 7. PHP on App Engine Image Courtesy: Google IO 2013
  • 9. Installation Python 2.7 Google App Engine SDK 1.8.4 PHP (Thread Safe) 5.4 Remember: Add each of it to your OS’s PATH variable. URLs http://www.python.org https://developers.google.com/appengine/ http://php.net/downloads.php Example installers (for Windows): GoogleAppEngine-1.8.3.msi and php-5.4.17-Win32-VC9-x86.zip
  • 10. Sign up Google provides a great platform for PHP PHP provides a language to Google.
  • 11. Create application Google provides a great platform for PHP PHP provides a language to Google.
  • 12. Creating application locally - 1 app.yaml application: <your-app-id> version: 1 runtime: php api_version: 1 threadsafe: true handlers: - url: /assets   script: assets - url: /.*   script: index.php YAML
  • 13. Creating application locally - 2 index.php <?php echo "Hello World!"; ?> PHP
  • 14. Creating application locally - 3 php.ini ; php.ini google_app_engine.enable_functions = "php_sapi_name, php_uname, phpinfo" INI
  • 15. Creating application locally - 4 phpinfo.php <?php echo phpinfo(); ?> PHP
  • 16. Deploying Executing Application (Runs Locally) dev_appserver.py --php_executable_path= C:phpphp-cgi.exe <application id> Update source to Google App Engine appcfg.py update php-4-gae Access on Google App Engine http://<application id>.appspot.com/
  • 18. Cloud SQL MySQL 5.5 in Cloud Automatic Backups Automatic replication Geo-Located with App Resource Limit Maximum Request Size 16 MB Maximum Response Size 16 MB //PDO $db = new PDO('mysql:unix_socket=/cloudsql/hello-php:my-cloudsql-instance;charset=utf8', '<username>', '<password>' ); //mysql_connect $conn = mysql_connect(":/cloudsql/hello-php:my-cloudsql-instance", "<username>", "<password>"); //mysqli $sql = new mysqli(null, "<username>", "<password>", null, null, "/cloudsql/hello-php:my- cloudsql-instance"); PHP
  • 19. Cloud Storage Built in Stream Wrappers allowing use of file api’s like file_get_contents(); $fp = fopen("gs://my_bucket/some_file.txt", "w"); fwrite($fp, "Hello"); fclose($fp); $options = [ "gs" => [ "Content-Type" => "text/plain" ]]; $ctx = stream_context_create($options); file_put_contents("gs://my_bucket/hello.txt", "Hello", 0, $ctx); PHP
  • 20. Functions disabled by default Manual enabling possible via php.ini gc_collect_cycles(), gc_enable() and gc_disable() getmypid() getmyuid() getrusage() getmyinode() getmygid() get_current_user() libxml_disable_entity_loader()* parse_str() phpinfo() phpversion() PHP
  • 21. Disabled Functions Permanently disabled disk_free_space() diskfreespace() escapeshellarg() and escapeshellcmd() exec() fsockopen() link() passthru() popen(), proc_close(), prog_get_status(), proc_nice(), proc_open() and proc_terminate() set_time_limit() shell_exec() show_source() symlink() system() tmpfile() tempnam() PHP
  • 22. Limits on PHP Limit Amount request size 32 megabytes response size 32 megabytes request duration 60 seconds maximum total number of files (app files and static files) 10,000 total 1,000 per directory maximum size of an application file 32 megabytes maximum size of a static file 32 megabytes maximum total size of all application and static files first 1 gigabyte is free $0.13 per gigabyte per month after first 1 gigabyte All database requests must finish within the HTTP request timer, around 60 seconds. Offline requests like cron tasks have a time limit of 10 minutes. Backend requests to Google Cloud SQL have a time limit of 10 minutes.
  • 23. Other Services Application Identity Logs Mail MemCache URL Fetch User Authentication Task Queues
  • 24. Web App : URL Shortener Use Bootstrap with PHP Recommended: CodeIgnitor or Yii Source Code available at https://github.com/bhavik1st/php- 4-gae Web App on Google App Engine http://php-4-gae.appspot.com/ $client = new Google_Client(); $service = new Google_UrlshortenerService($client); $taskDone = false; if (isset($_GET['url'])) { // Start to make API requests. $url = new Google_Url(); $url->longUrl = $_GET['url']; //Shorten URL $shortUrl = $service->url->insert($url); $taskDone = true; } PHP
  • 25. Demo
  • 26. References & Other details developer.google.com venturebeat.com udemy.org Disclaimer: All images & logos used in the presentation are various trademarks of respective organizations. Other details Code : https://github.com/bhavik1st/php-4-gae Article: http://goo.gl/X7hbBI
  • 28. Thank you for your attention Bhavik Shah Twitter: bhavik1st Email: bhavik1st@gmail.com www.linkedin.com/in/bhavik1st

Editor's Notes

  1. Image Courtesy: Wikimedia, http://gdg-generator.appspot.com/, GDG
  2. PaaS - Platform as a Service, Web Hosting Scalable - Storages, Databases and Services Reliable - Distributed, Redundancy Languages - Python, Java, Go and PHP * PaaS uses same infrastructure that Google Applications Use. Reliability zero downtime Google IO 2013 May 14 2013 San Fransisco.
  3. Despite node and Ruby http://en.wikipedia.org/wiki/PHP#cite_note-W3Techs_usage_statistics-79 http://w3techs.com/technologies/overview/programming_language/all stood for  Personal Home Page , [4]  it now stands for  PHP: Hypertext Preprocessor , 
  4. Despite critic of PHP about language inconsistency, scalability, performance.
  5. Multiple data centers Memcache optimizes Mysql library ..
  6. PaaS - Platform as a Service, Web Hosting Scalable - Storages, Databases and Services Reliable - Distributed, Redundancy Languages - Python, Java, Go and PHP * PaaS uses same infrastructure that Google Applications Use. Reliability zero downtime Google IO 2013 May 14 2013 San Fransisco.
  7. PaaS - Platform as a Service, Web Hosting Scalable - Storages, Databases and Services Reliable - Distributed, Redundancy Languages - Python, Java, Go and PHP * PaaS uses same infrastructure that Google Applications Use. Reliability zero downtime Google IO 2013 May 14 2013 San Fransisco.
  8. PDO $db = new PDO(&apos;mysql:unix_socket=/cloudsql/hello-php:my-cloudsql-instance;charset=utf8&apos;,   &apos;&lt;username&gt;&apos;,   &apos;&lt;password&gt;&apos; ); mysql_connect $conn = mysql_connect(&quot;:/cloudsql/hello-php:my-cloudsql-instance&quot;, &quot;&lt;username&gt;&quot;, &quot;&lt;password&gt;&quot;); mysqli $sql = new mysqli(null, &quot;&lt;username&gt;&quot;, &quot;&lt;password&gt;&quot;, null, null, &quot;/cloudsql/hello-php:my-cloudsql-instance&quot;);
  9. PaaS - Platform as a Service, Web Hosting Scalable - Storages, Databases and Services Reliable - Distributed, Redundancy Languages - Python, Java, Go and PHP * PaaS uses same infrastructure that Google Applications Use. Reliability zero downtime Google IO 2013 May 14 2013 San Fransisco.
  10. $client = new Google_Client();$service = new Google_UrlshortenerService($client);$taskDone = false; if (isset($_GET[&apos;url&apos;])) { // Start to make API requests. $url = new Google_Url(); $url-&gt;longUrl = $_GET[&apos;url&apos;]; //Shorten URL $shortUrl = $service-&gt;url-&gt;insert($url); $taskDone = true; }