SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Shahar Evron | Zend Technologies
Best Practices in
PHP Deployment
Agenda
●
The PHP Application Lifecycle
●
What problem are we trying to solve?
●
What are the current ways to solve it?
●
A little bit of what Zend is working on
●
Hopefully more discussion than talk
●
This is what I've learned
●
Maybe you know better
A few things about me...
●
Shahar Evron (‫ֹן‬‫ו‬‫ְר‬‫ב‬ֶ‫ע‬ ‫ַר‬‫ח‬ָ‫ש‬)
●
Working with PHP since 2002
●
In Zend since 2005
●
“Technical Product Manager”
●
I'm not a programmer, I decide stuff ;)
●
I get to play with cool technical sh!t
●
My boss is in marketing (but I do not talk about
it)
●
I also try to contribute to Zend Framework
Part I: Broken Cycles
The Development Lifecycle
Development
●
Purpose
●
Provide developers with an environment to
work in efficiently
●
Characteristics
●
Should be similar to production, though it
usually isn’t
●
Often more open security
●
Error reporting and debugging enabled
●
Local or semi-local to the developer
Testing
●
Purpose
●
Provide a stable environment to test
functionality on
●
Characteristics
●
Continuous Integration could be included
●
Environment closer to production setup
●
Stable - no development occurs, only testing
●
Test a specific code snapshot / tag
●
Developers should not do the testing
Staging
●
Purpose
●
To test your deployment process / scripting
●
Not your code!
●
Characteristics
●
A specific version is pushed after it passes
QA
●
No developer access!
●
Very restricted outbound networking
●
Mirrors production as best as possible
Production
●
Purpose
●
Do whatever it is that it’s supposed to be
doing (duh)
●
Characteristics
●
Developers do not have access
●
Deployment should be done without
requiring developer input
●
Tuned for high performance and security
Bridging the Gap
developers sysadmins
What Are We Trying To Solve?
●
Bridge the gap
●
And be able to safely cross the bridge a few
times a day
●
Avoid technical difficulties along the way
●
Controlled, repeatable process
●
Zero downtime
●
Cluster-wide consistency
●
Planned recovery
Application Considerations
●
Build Semi-Portable Applications
●
Separate configuration from code
●
Configuration can be environment aware
●
Zend_Config is good at this
●
Environment should be set outside code
●
Default to production configuration to
reduce risk
A Quick ZF Example: config.ini
[production]
log.verbosity = WARN
php.display_errors = off
php.error_reporting = E_ALL & ~E_NOTICE
db.adapter = PDO_MYSQL
db.hostname = myhugedbcluster.myapp.lan
db.dbname = productiondb
[testing:production]
log.verbosity = NOTICE
php.error_reporting = E_ALL | E_STRICT
db.hostname = mytestdb.myapp.lan
db.dbname = testingdb
[development:testing]
log.verbosity = DEBUG
php.display_errors = on
db.adapter = PDO_SQLITE
db.dbname = localdev.sq3
A Quick ZF Example: index.php
/* Set the application environment */
if (! ($environment = getenv('MYAPP_ENV'))) {
$environment = 'production';
}
/* Or, in enigmatic PHP 5.3 shorthand style ;) */
$environment = getenv('MYAPP_ENV') ?: 'production';
/* Load configuration file */
$config = new Zend_Config_Ini($configFile, $environment);
/* Do the usual stuff... */
Zend_Registry::set('config', $config);
A Quick ZF Example: httpd.conf
Alias /myapp-dev /home/shahar/Sites/myapp-dev/public
<Directory /home/shahar/Sites/myapp-dev/public>
Order allow,deny
Allow from all
AllowOverride All
# Set the application environment
SetENV MYAPP_ENV development
</Directory>
Part II: The Bridge of Death
Requirements
●
Supports upgrading existing code
●
Can roll back in case of a blowup
●
Can deploy to different environments
●
Reproducible deployments
●
Minimal downtime
●
Minimal in-house development
●
Maximal consistency
Solution #1: rsync
●
Benefits
●
Widely available and used by *nix sysadmins
●
Incremental pushes
●
Drawbacks
●
No deployment hook scripts support
●
Basically a file-system copying solution
●
Does not understand versioning or context
●
Incremental pushes
Solution #2: Source Control
●
Benefits
●
Easy, fits in the workflow
●
You already use it (god I hope you do...)
●
Supports versioning, pre/post deploy hooks
●
Drawbacks
●
Requires production access to entire source
repository (security)
●
Usually no context understanding
●
Developers cross over to the admin side
Solution #3: PEAR
●
Benefits
●
Designed for PHP, maintained by PHP folks
●
Very scriptable
●
Understands PHP context
●
Cross Platform
●
Drawbacks
●
Format not 100% ideal for app deployment
●
Available tooling is restrictive
●
Admins cross over to the developer side
Solution #4: OS Native
●
Benefits
●
Works natively with server provisioning
●
Your sysadmin will buy you a beer
●
Can describe OS-level requirements
●
Lots of problems solved by someone else
●
Drawbacks
●
Environment specific
●
No tight PHP integration
●
Will require quite a lot of “build” knowhow
Solution #5: Capistrano
●
Benefits
●
Clustering Support
●
Designed for Web Deployments
●
Drawbacks
●
Designed for RoR deployments
●
Will require some manual scripting to support
PHP
●
Usually has tight SCM coupling
What should I use?
●
Where are you on the maturity scale?
●
How much control do you need?
●
How portable do you need to be?
●
Can you afford downtime?
●
Can you afford a non-scalable solution?
●
Can you afford in-house maintenance?
Part III: Deliberate Ambiguity
So what's up with Zend Server?
●
Zend is working on a deployment solution
●
You have seen some of it in today's keynote
●
IT'S NOT READY YET!
●
I cannot say when it's going to be ready
●
It's a prototype, lots of things may change
●
I want your feedback!
Zend Server Deployment
●
Based on an open, simple package format
●
Basically a zip/tarball with an XML
descriptor
●
You can create it using common tools
●
Package includes and defines:
●
Code, hook scripts
●
Configuration, dependancies
●
Required and optional parameters
Zend Server Deployment
●
Synchronized cluster deployments
●
Two-step stage / activate workflow
●
Apache / IIS integration
●
Will define vhost / alias as needed
●
Upgrades
●
Rollbacks
●
A simple switch-back to the previous version
which is already staged
Questions? Feedback?
●
Find me at the Zend booth
●
Email me: shahar.e@zend.com
●
IRC: #zftalk, #zendserver @ FreeNode
Thank You!

Contenu connexe

Tendances

MySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete TutorialMySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete TutorialSveta Smirnova
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestI Goo Lee
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Hao H. Zhang
 
Kubernetes walkthrough
Kubernetes walkthroughKubernetes walkthrough
Kubernetes walkthroughSangwon Lee
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installationRobert Bohne
 
Google App Engine
Google App EngineGoogle App Engine
Google App EngineCsaba Toth
 
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
Containerising the Mule Runtime with Kubernetes & From Zero to Batch  : MuleS...Containerising the Mule Runtime with Kubernetes & From Zero to Batch  : MuleS...
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...Angel Alberici
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced FunctionsWebStackAcademy
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBhargav Anadkat
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBNicola Iarocci
 
Easy data-with-spring-data-jpa
Easy data-with-spring-data-jpaEasy data-with-spring-data-jpa
Easy data-with-spring-data-jpaStaples
 
OpenStack Presentation
OpenStack PresentationOpenStack Presentation
OpenStack PresentationAllan Searle
 
Knative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and OpenshiftKnative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and OpenshiftChris Suszyński
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby BasicsSHC
 
Базы данных в 2020
Базы данных в 2020Базы данных в 2020
Базы данных в 2020Timur Shemsedinov
 

Tendances (20)

MySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete TutorialMySQL Performance Schema in Action: the Complete Tutorial
MySQL Performance Schema in Action: the Complete Tutorial
 
MySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software TestMySQL/MariaDB Proxy Software Test
MySQL/MariaDB Proxy Software Test
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
 
Kubernetes walkthrough
Kubernetes walkthroughKubernetes walkthrough
Kubernetes walkthrough
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installation
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
Containerising the Mule Runtime with Kubernetes & From Zero to Batch  : MuleS...Containerising the Mule Runtime with Kubernetes & From Zero to Batch  : MuleS...
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced Functions
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Developing RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDBDeveloping RESTful Web APIs with Python, Flask and MongoDB
Developing RESTful Web APIs with Python, Flask and MongoDB
 
Easy data-with-spring-data-jpa
Easy data-with-spring-data-jpaEasy data-with-spring-data-jpa
Easy data-with-spring-data-jpa
 
OpenStack Presentation
OpenStack PresentationOpenStack Presentation
OpenStack Presentation
 
Jenkins x gitops
Jenkins x gitopsJenkins x gitops
Jenkins x gitops
 
Serverless with Google Cloud
Serverless with Google CloudServerless with Google Cloud
Serverless with Google Cloud
 
Knative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and OpenshiftKnative, Serverless on Kubernetes, and Openshift
Knative, Serverless on Kubernetes, and Openshift
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby Basics
 
Базы данных в 2020
Базы данных в 2020Базы данных в 2020
Базы данных в 2020
 

En vedette

PHP & The secure development lifecycle
PHP & The secure development lifecyclePHP & The secure development lifecycle
PHP & The secure development lifecycleguestaaf017
 
A content repository for your PHP application or CMS?
A content repository for your PHP application or CMS?A content repository for your PHP application or CMS?
A content repository for your PHP application or CMS?Paul Borgermans
 
PHP Application Frameworks
PHP Application FrameworksPHP Application Frameworks
PHP Application FrameworksSpyridon Safras
 
PHP 5 + MySQL 5 = A Perfect 10
PHP 5 + MySQL 5 = A Perfect 10PHP 5 + MySQL 5 = A Perfect 10
PHP 5 + MySQL 5 = A Perfect 10Adam Trachtenberg
 
5.2 pembangunan atur cara
5.2 pembangunan atur cara5.2 pembangunan atur cara
5.2 pembangunan atur caradean36
 
Slot 5 proses pembangunan multimedia
Slot 5 proses pembangunan multimediaSlot 5 proses pembangunan multimedia
Slot 5 proses pembangunan multimediaramly5597
 
PHP & MySQL 教學
PHP & MySQL 教學PHP & MySQL 教學
PHP & MySQL 教學Bo-Yi Wu
 
Konsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman webKonsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman webAhmad Faizar
 
Nota Pembangunan Laman Web
Nota Pembangunan Laman WebNota Pembangunan Laman Web
Nota Pembangunan Laman WebFarah Waheda
 
Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture AppDynamics
 

En vedette (12)

PHP & The secure development lifecycle
PHP & The secure development lifecyclePHP & The secure development lifecycle
PHP & The secure development lifecycle
 
Fitur baru
Fitur baruFitur baru
Fitur baru
 
Why You Should Choose PHP For Your Future Web Development?
Why You Should Choose PHP For Your Future Web Development?Why You Should Choose PHP For Your Future Web Development?
Why You Should Choose PHP For Your Future Web Development?
 
A content repository for your PHP application or CMS?
A content repository for your PHP application or CMS?A content repository for your PHP application or CMS?
A content repository for your PHP application or CMS?
 
PHP Application Frameworks
PHP Application FrameworksPHP Application Frameworks
PHP Application Frameworks
 
PHP 5 + MySQL 5 = A Perfect 10
PHP 5 + MySQL 5 = A Perfect 10PHP 5 + MySQL 5 = A Perfect 10
PHP 5 + MySQL 5 = A Perfect 10
 
5.2 pembangunan atur cara
5.2 pembangunan atur cara5.2 pembangunan atur cara
5.2 pembangunan atur cara
 
Slot 5 proses pembangunan multimedia
Slot 5 proses pembangunan multimediaSlot 5 proses pembangunan multimedia
Slot 5 proses pembangunan multimedia
 
PHP & MySQL 教學
PHP & MySQL 教學PHP & MySQL 教學
PHP & MySQL 教學
 
Konsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman webKonsep pembangunan tapak web & laman web
Konsep pembangunan tapak web & laman web
 
Nota Pembangunan Laman Web
Nota Pembangunan Laman WebNota Pembangunan Laman Web
Nota Pembangunan Laman Web
 
Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture Anatomy of a Modern PHP Application Architecture
Anatomy of a Modern PHP Application Architecture
 

Similaire à Best Practices in PHP Application Deployment

Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHPRogério Vicente
 
Slides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetingsSlides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetings10n Software, LLC
 
Zend Server: A Guided Tour
Zend Server: A Guided TourZend Server: A Guided Tour
Zend Server: A Guided TourShahar Evron
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Lorna Mitchell
 
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...Zend by Rogue Wave Software
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In PhpWilco Jansen
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applicationsEnrico Zimuel
 
Clean application development (talk)
Clean application development (talk)Clean application development (talk)
Clean application development (talk)Adam Culp
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentAbid Malik
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testingEngineor
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with MagentoTu Hoang
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupalsmithmilner
 
Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)
Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)
Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)Valery Lourie
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedAnna Royzman
 
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Francisco José Seva Mora
 
PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3David Yell
 
Microsoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on WindowsMicrosoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on WindowsEnterprise PHP Center
 

Similaire à Best Practices in PHP Application Deployment (20)

Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
 
Slides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetingsSlides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetings
 
Zend Server: A Guided Tour
Zend Server: A Guided TourZend Server: A Guided Tour
Zend Server: A Guided Tour
 
Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)Passing the Joel Test in the PHP World (phpbnl10)
Passing the Joel Test in the PHP World (phpbnl10)
 
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
Costruire un sito e-commerce in alta affidabilità con Magento e Zend Server C...
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In Php
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applications
 
Clean application development (talk)
Clean application development (talk)Clean application development (talk)
Clean application development (talk)
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
 
Daniel Sloof: Magento on HHVM
Daniel Sloof: Magento on HHVMDaniel Sloof: Magento on HHVM
Daniel Sloof: Magento on HHVM
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)
Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)
Using PHP IDEs with Drupal (DrupalDevDays Szeged 2014)
 
Cynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not GuaranteedCynthia Wu: Satisfaction Not Guaranteed
Cynthia Wu: Satisfaction Not Guaranteed
 
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)Xdebug and Drupal8 tests (PhpUnit and Simpletest)
Xdebug and Drupal8 tests (PhpUnit and Simpletest)
 
PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3PHP South Coast - Don't code bake, an introduction to CakePHP 3
PHP South Coast - Don't code bake, an introduction to CakePHP 3
 
Microsoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on WindowsMicrosoft TechDays 2011 - PHP on Windows
Microsoft TechDays 2011 - PHP on Windows
 
Zend
ZendZend
Zend
 
green
greengreen
green
 

Plus de Shahar Evron

Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on WindowsShahar Evron
 
Zend Server: Scalability & Performance
Zend Server: Scalability & PerformanceZend Server: Scalability & Performance
Zend Server: Scalability & PerformanceShahar Evron
 
Scaling PHP Applications with Zend Platform
Scaling PHP Applications with Zend PlatformScaling PHP Applications with Zend Platform
Scaling PHP Applications with Zend PlatformShahar Evron
 
Zend Framework Components for non-framework Development
Zend Framework Components for non-framework DevelopmentZend Framework Components for non-framework Development
Zend Framework Components for non-framework DevelopmentShahar Evron
 
PHP ואבטחה - חלק שני
PHP ואבטחה - חלק שניPHP ואבטחה - חלק שני
PHP ואבטחה - חלק שניShahar Evron
 
PHP ואבטחה - חלק ראשון
PHP ואבטחה - חלק ראשוןPHP ואבטחה - חלק ראשון
PHP ואבטחה - חלק ראשוןShahar Evron
 
PHP - עבר הווה ועתיד
PHP - עבר הווה ועתידPHP - עבר הווה ועתיד
PHP - עבר הווה ועתידShahar Evron
 
Content Indexing with Zend_Search_Lucene
Content Indexing with Zend_Search_LuceneContent Indexing with Zend_Search_Lucene
Content Indexing with Zend_Search_LuceneShahar Evron
 
Building Scalable Development Environments
Building Scalable Development EnvironmentsBuilding Scalable Development Environments
Building Scalable Development EnvironmentsShahar Evron
 

Plus de Shahar Evron (11)

Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
PHP and Zend Framework on Windows
PHP and Zend Framework on WindowsPHP and Zend Framework on Windows
PHP and Zend Framework on Windows
 
Zend Server: Scalability & Performance
Zend Server: Scalability & PerformanceZend Server: Scalability & Performance
Zend Server: Scalability & Performance
 
Intro To Couch Db
Intro To Couch DbIntro To Couch Db
Intro To Couch Db
 
Scaling PHP Applications with Zend Platform
Scaling PHP Applications with Zend PlatformScaling PHP Applications with Zend Platform
Scaling PHP Applications with Zend Platform
 
Zend Framework Components for non-framework Development
Zend Framework Components for non-framework DevelopmentZend Framework Components for non-framework Development
Zend Framework Components for non-framework Development
 
PHP ואבטחה - חלק שני
PHP ואבטחה - חלק שניPHP ואבטחה - חלק שני
PHP ואבטחה - חלק שני
 
PHP ואבטחה - חלק ראשון
PHP ואבטחה - חלק ראשוןPHP ואבטחה - חלק ראשון
PHP ואבטחה - חלק ראשון
 
PHP - עבר הווה ועתיד
PHP - עבר הווה ועתידPHP - עבר הווה ועתיד
PHP - עבר הווה ועתיד
 
Content Indexing with Zend_Search_Lucene
Content Indexing with Zend_Search_LuceneContent Indexing with Zend_Search_Lucene
Content Indexing with Zend_Search_Lucene
 
Building Scalable Development Environments
Building Scalable Development EnvironmentsBuilding Scalable Development Environments
Building Scalable Development Environments
 

Dernier

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 

Dernier (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 

Best Practices in PHP Application Deployment

  • 1. Shahar Evron | Zend Technologies Best Practices in PHP Deployment
  • 2. Agenda ● The PHP Application Lifecycle ● What problem are we trying to solve? ● What are the current ways to solve it? ● A little bit of what Zend is working on ● Hopefully more discussion than talk ● This is what I've learned ● Maybe you know better
  • 3. A few things about me... ● Shahar Evron (‫ֹן‬‫ו‬‫ְר‬‫ב‬ֶ‫ע‬ ‫ַר‬‫ח‬ָ‫ש‬) ● Working with PHP since 2002 ● In Zend since 2005 ● “Technical Product Manager” ● I'm not a programmer, I decide stuff ;) ● I get to play with cool technical sh!t ● My boss is in marketing (but I do not talk about it) ● I also try to contribute to Zend Framework
  • 4. Part I: Broken Cycles
  • 6. Development ● Purpose ● Provide developers with an environment to work in efficiently ● Characteristics ● Should be similar to production, though it usually isn’t ● Often more open security ● Error reporting and debugging enabled ● Local or semi-local to the developer
  • 7. Testing ● Purpose ● Provide a stable environment to test functionality on ● Characteristics ● Continuous Integration could be included ● Environment closer to production setup ● Stable - no development occurs, only testing ● Test a specific code snapshot / tag ● Developers should not do the testing
  • 8. Staging ● Purpose ● To test your deployment process / scripting ● Not your code! ● Characteristics ● A specific version is pushed after it passes QA ● No developer access! ● Very restricted outbound networking ● Mirrors production as best as possible
  • 9. Production ● Purpose ● Do whatever it is that it’s supposed to be doing (duh) ● Characteristics ● Developers do not have access ● Deployment should be done without requiring developer input ● Tuned for high performance and security
  • 11. What Are We Trying To Solve? ● Bridge the gap ● And be able to safely cross the bridge a few times a day ● Avoid technical difficulties along the way ● Controlled, repeatable process ● Zero downtime ● Cluster-wide consistency ● Planned recovery
  • 12. Application Considerations ● Build Semi-Portable Applications ● Separate configuration from code ● Configuration can be environment aware ● Zend_Config is good at this ● Environment should be set outside code ● Default to production configuration to reduce risk
  • 13. A Quick ZF Example: config.ini [production] log.verbosity = WARN php.display_errors = off php.error_reporting = E_ALL & ~E_NOTICE db.adapter = PDO_MYSQL db.hostname = myhugedbcluster.myapp.lan db.dbname = productiondb [testing:production] log.verbosity = NOTICE php.error_reporting = E_ALL | E_STRICT db.hostname = mytestdb.myapp.lan db.dbname = testingdb [development:testing] log.verbosity = DEBUG php.display_errors = on db.adapter = PDO_SQLITE db.dbname = localdev.sq3
  • 14. A Quick ZF Example: index.php /* Set the application environment */ if (! ($environment = getenv('MYAPP_ENV'))) { $environment = 'production'; } /* Or, in enigmatic PHP 5.3 shorthand style ;) */ $environment = getenv('MYAPP_ENV') ?: 'production'; /* Load configuration file */ $config = new Zend_Config_Ini($configFile, $environment); /* Do the usual stuff... */ Zend_Registry::set('config', $config);
  • 15. A Quick ZF Example: httpd.conf Alias /myapp-dev /home/shahar/Sites/myapp-dev/public <Directory /home/shahar/Sites/myapp-dev/public> Order allow,deny Allow from all AllowOverride All # Set the application environment SetENV MYAPP_ENV development </Directory>
  • 16. Part II: The Bridge of Death
  • 17. Requirements ● Supports upgrading existing code ● Can roll back in case of a blowup ● Can deploy to different environments ● Reproducible deployments ● Minimal downtime ● Minimal in-house development ● Maximal consistency
  • 18. Solution #1: rsync ● Benefits ● Widely available and used by *nix sysadmins ● Incremental pushes ● Drawbacks ● No deployment hook scripts support ● Basically a file-system copying solution ● Does not understand versioning or context ● Incremental pushes
  • 19. Solution #2: Source Control ● Benefits ● Easy, fits in the workflow ● You already use it (god I hope you do...) ● Supports versioning, pre/post deploy hooks ● Drawbacks ● Requires production access to entire source repository (security) ● Usually no context understanding ● Developers cross over to the admin side
  • 20. Solution #3: PEAR ● Benefits ● Designed for PHP, maintained by PHP folks ● Very scriptable ● Understands PHP context ● Cross Platform ● Drawbacks ● Format not 100% ideal for app deployment ● Available tooling is restrictive ● Admins cross over to the developer side
  • 21. Solution #4: OS Native ● Benefits ● Works natively with server provisioning ● Your sysadmin will buy you a beer ● Can describe OS-level requirements ● Lots of problems solved by someone else ● Drawbacks ● Environment specific ● No tight PHP integration ● Will require quite a lot of “build” knowhow
  • 22. Solution #5: Capistrano ● Benefits ● Clustering Support ● Designed for Web Deployments ● Drawbacks ● Designed for RoR deployments ● Will require some manual scripting to support PHP ● Usually has tight SCM coupling
  • 23. What should I use? ● Where are you on the maturity scale? ● How much control do you need? ● How portable do you need to be? ● Can you afford downtime? ● Can you afford a non-scalable solution? ● Can you afford in-house maintenance?
  • 24. Part III: Deliberate Ambiguity
  • 25. So what's up with Zend Server? ● Zend is working on a deployment solution ● You have seen some of it in today's keynote ● IT'S NOT READY YET! ● I cannot say when it's going to be ready ● It's a prototype, lots of things may change ● I want your feedback!
  • 26. Zend Server Deployment ● Based on an open, simple package format ● Basically a zip/tarball with an XML descriptor ● You can create it using common tools ● Package includes and defines: ● Code, hook scripts ● Configuration, dependancies ● Required and optional parameters
  • 27. Zend Server Deployment ● Synchronized cluster deployments ● Two-step stage / activate workflow ● Apache / IIS integration ● Will define vhost / alias as needed ● Upgrades ● Rollbacks ● A simple switch-back to the previous version which is already staged
  • 28. Questions? Feedback? ● Find me at the Zend booth ● Email me: shahar.e@zend.com ● IRC: #zftalk, #zendserver @ FreeNode