SlideShare a Scribd company logo
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!

More Related Content

What's hot

Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
wahidullah mudaser
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
Wei-Ning Huang
 
CI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOWCI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOW
AddWeb Solution Pvt. Ltd.
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
Arti Parab Academics
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
Ishin Vin
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
Jim Yeh
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in Golang
Oliver N
 
Php
PhpPhp
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
Areski Belaid
 
ARI and AGI, a powerful combination
ARI and AGI, a powerful combinationARI and AGI, a powerful combination
ARI and AGI, a powerful combination
Jöran Vinzens
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic FrameworkHybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
Cihad Horuzoğlu
 
JavaScript
JavaScriptJavaScript
JavaScript
Vidyut Singhania
 
Best practices for RESTful web service design
Best practices for RESTful web service designBest practices for RESTful web service design
Best practices for RESTful web service design
Ramin Orujov
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
Basil N G
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
Bo-Yi Wu
 
Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)
Chandrapal Badshah
 

What's hot (20)

Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
CI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOWCI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOW
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
 
Php ppt
Php pptPhp ppt
Php ppt
 
Codeigniter framework
Codeigniter framework Codeigniter framework
Codeigniter framework
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in Golang
 
Php
PhpPhp
Php
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
 
ARI and AGI, a powerful combination
ARI and AGI, a powerful combinationARI and AGI, a powerful combination
ARI and AGI, a powerful combination
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic FrameworkHybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Best practices for RESTful web service design
Best practices for RESTful web service designBest practices for RESTful web service design
Best practices for RESTful web service design
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)Pentesting Android Apps using Frida (Beginners)
Pentesting Android Apps using Frida (Beginners)
 

Viewers also liked

PHP & The secure development lifecycle
PHP & The secure development lifecyclePHP & The secure development lifecycle
PHP & The secure development lifecycle
guestaaf017
 
Fitur baru
Fitur baruFitur baru
Fitur baru
Rusya Yahaya
 
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?
Grey Matter India Technologies PVT LTD
 
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 Frameworks
Spyridon 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 web
Ahmad 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
 

Viewers also liked (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
 

Similar to Best Practices in PHP Application Deployment

Test Driven Development with PHP
Test Driven Development with PHPTest Driven Development with PHP
Test Driven Development with PHP
Rogé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 Tour
Shahar 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 Php
Wilco Jansen
 
How to scale PHP applications
How to scale PHP applicationsHow to scale PHP applications
How to scale PHP applications
Enrico 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 Development
Abid Malik
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
Engineor
 
PHPUnit with Magento
PHPUnit with MagentoPHPUnit with Magento
PHPUnit with Magento
Tu 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 Guaranteed
Anna 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 3
David 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
 

Similar to 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
 

More from 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 Windows
Shahar Evron
 
Zend Server: Scalability & Performance
Zend Server: Scalability & PerformanceZend Server: Scalability & Performance
Zend Server: Scalability & Performance
Shahar Evron
 
Intro To Couch Db
Intro To Couch DbIntro To Couch Db
Intro To Couch Db
Shahar Evron
 
Scaling PHP Applications with Zend Platform
Scaling PHP Applications with Zend PlatformScaling PHP Applications with Zend Platform
Scaling PHP Applications with Zend Platform
Shahar 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 Development
Shahar 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_Lucene
Shahar Evron
 
Building Scalable Development Environments
Building Scalable Development EnvironmentsBuilding Scalable Development Environments
Building Scalable Development EnvironmentsShahar Evron
 

More from 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
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

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