SlideShare a Scribd company logo
Write PHP, deploy
  everywhere
  Confoo 2011, Montreal (CA)
Michelangelo van Dam
• Independent Consultant
• Zend Certified Engineer (ZCE)
• President of PHPBenelux
Topics


    Live hacking
     FTP deploy
   Version control
Automated deployment
Anywhere deployment
Related
Rob Allen
  Stress Free Deployment




                                http://www.flickr.com/photos/stuartherbert/5089882125
http://akrabat.com/talks/#sfd
Deployment types
Live Hacking
Good old days
FTP deploy
Manual FTP deploy
Version control
Code management
Versioning concepts
Symlink switch old
path/to/webapp
path/to/webapp-1.0.2 -> path/to/webapp
path/to/webapp-1.0.3
Symlink switch new
path/to/webapp
path/to/webapp-1.0.2
path/to/webapp-1.0.3 -> path/to/webapp
Automated deployment
Concept: build
• required steps
•- to “build” an application
     validate
 -   test
 -   document
 -   package
All tools needed!
Phing
• build tool written in PHP
• comparable to ANT build scripts
• impressive list of task templates
• extensible for missing tasks
Phing HelloWorld!
<?xml version="1.0" encoding="UTF-8"?>
<project name="demo" default="build">
  <target name="build">
    <echo msg="Hello World!"/>
  </target>
</project>
Write php deploy everywhere
Export from SVN
<property name="buildpath" value="./build"/>
<property name="repopath"
          value="https://svn.myserver.com/demo/trunk"/>
  <target name="prepare">
      <delete dir="${buildpath}"
              includeemptydirs="true"
              quiet="true"
              verbose="false"
              failonerror="false" />
      <mkdir dir="${buildpath}"/>
  </target>
  <target name="getsources" depends="prepare">
      <svnexport svnpath="/usr/bin/svn"
                 force="true"
                 nocache="true"
                 repositoryurl="${repopath}"
                 todir="${buildpath}"/>
  </target>
Write php deploy everywhere
More info: phing.info
Anywhere deployment
Deployment options
• platform (windows, linux, i5, …)
• database engine (mysql, ms sql, oracle)
•- deployment protocols
     rsync
 -   FTP
Linux server
Example deploy Linux
<target name="deploy-linux">
    <exec dir="./build"
          command="rsync -rq user@server.com:/srv/www/
demo"/>
</target>
Write php deploy everywhere
Windows server
Deploy to windows
<target name="deploy-windows" depends="version-bugfix">
    <ftpdeploy host="${env.win-prod}"
               port="21"
               username="${auth.win-prod.username}"
               password="${auth.win-prod.password}"
               dir="/"
               mode="binary"
               clearfirst="false">
               <fileset dir=".">
                   <exclude=”./library/Zend”/>
                   <exclude=”./library/ZendX”/>
               </fileset>
    </ftpdeploy>
</target>
Windows Azure
A few remarks
•- runs only on windows
    but still uses phing :-)
• takes a considerable time to upload
• instances are defined in the config
Setting properties
<property
  name="cmd-cspack"
  value="c:Program FilesWindows Azure SDKv1.3bin
cspack.exe"
  override="false"/>
<property
  name="cmd-csrun"
  value="c:Program FilesWindows Azure SDKv1.3bin
csrun.exe"
  override="false"/>
Prepare for Azure
<target name="prepare-azure" depends="version-bugfix">
    <!-- start building in ./bldtmp -->
    <mkdir dir="./bldtmp" />

    <copy todir="./bldtmp" overwrite="true">
      <fileset dir="./deploy/azure">
        <include name="**/*.*" />
      </fileset>
    </copy>
    <copy todir="./bldtmp/PhpOnAzure.Web" overwrite="true">
      <fileset dir=".">
        <include name="**/*"/>
        <include name="*"/>
      </fileset>
    </copy>
</target>
Deploy to Azure
<target name="deploy-azure" depends="prepare-azure">
    <exec command="&quot;${cmd-cspack}&quot;
ServiceDefinition.csdef /
role:PhpOnAzure.Web;PhpOnAzure.Web /out:PhpAzure.cspkg"
          dir="./bldtmp" />
    <mkdir dir="./release/${phing.project.name}-$
{version.number}/azure-prod" />
    <copy todir="./release/${phing.project.name}-$
{version.number}/azure-prod" overwrite="true">
      <fileset dir="./bldtmp">
        <include name="PhpOnAzure.cspkg"/>
        <include name="ServiceConfiguration.cscfg"/>
      </fileset>
    </copy>
</target>
Write php deploy everywhere
Write php deploy everywhere
Continuous Integration
Continuous Building
Considerations
Some reminders
•- design your apps to work everywhere
    use OOP abstraction layers
 - use plugins
 - take care of sessions!
• investigate “the other platform”
 - gives you a head start over competetion
 - teaches you the caveats
• “cloud” solutions are in high-demand
 - see what works best for your customer
automate what you might
   forget under stress!
Write php deploy everywhere
Questions
• http://slideshare.net/DragonBe/write-php-deply-
  everywhere

• http://twitter.com/DragonBe
• http://facebook.com/DragonBe
• http://joind.in/2782

More Related Content

PDF
Write php deploy everywhere tek11
PDF
Integration Test Cucumber + Webrat + Selenium
 
PPTX
Express JS
PDF
Web development automatisation for fun and profit (Artem Daniliants)
PPTX
Build RESTful API Using Express JS
PDF
Network Automation: Ansible 102
PDF
快快樂樂用Homestead
PDF
WordPress mit Composer und Git verwalten
Write php deploy everywhere tek11
Integration Test Cucumber + Webrat + Selenium
 
Express JS
Web development automatisation for fun and profit (Artem Daniliants)
Build RESTful API Using Express JS
Network Automation: Ansible 102
快快樂樂用Homestead
WordPress mit Composer und Git verwalten

What's hot (20)

PPTX
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
PPTX
Powershell: Tu nuevo mejor amigo
PDF
Ansible Automation to Rule Them All
PDF
Running node.js as a service behind nginx/varnish
PPTX
Ansible - Crash course
PDF
Ansible Introduction - Ansible Brno #1 - David Karban
PPTX
Ansible presentation
PPT
Tips for a Faster Website
PDF
Provisioning iOS CI Server with Ansible
PDF
Automation and Ansible
PDF
Ansible is the simplest way to automate. MoldCamp, 2015
PDF
DevOps - Infrastructure as Code by Andre Marcelo-Tanner
PPTX
Ansible presentation
PDF
HTML5 tutorial: canvas, offfline & sockets
PDF
#OktoCampus - Workshop : An introduction to Ansible
PDF
Die .htaccess richtig nutzen
PDF
Ansible roles done right
PDF
Introducing Ansible
PDF
Improving WordPress performance (xdebug and profiling)
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
Powershell: Tu nuevo mejor amigo
Ansible Automation to Rule Them All
Running node.js as a service behind nginx/varnish
Ansible - Crash course
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible presentation
Tips for a Faster Website
Provisioning iOS CI Server with Ansible
Automation and Ansible
Ansible is the simplest way to automate. MoldCamp, 2015
DevOps - Infrastructure as Code by Andre Marcelo-Tanner
Ansible presentation
HTML5 tutorial: canvas, offfline & sockets
#OktoCampus - Workshop : An introduction to Ansible
Die .htaccess richtig nutzen
Ansible roles done right
Introducing Ansible
Improving WordPress performance (xdebug and profiling)
Ad

Viewers also liked (10)

PPTX
Puppet at Scale – Case Study of PayPal's Learnings - PuppetConf 2013
PDF
Build your own clouds with Chef and MCollective
PDF
Masterless puppet
PDF
Puppet Camp Tokyo 2014: Why we stopped using Puppet Agent Daemon
PDF
Demystifying puppet
PDF
Puppet Camp DC 2014: Managing Puppet with MCollective
PDF
Introduction to orchestration using Mcollective
PDF
Continuous Deployment Applied at MyHeritage
PDF
PuppetConf track overview: Modern Infrastructure
KEY
11 Ways to Hack Puppet for Fun and Productivity - Luke Kanies - Velocity 2012
Puppet at Scale – Case Study of PayPal's Learnings - PuppetConf 2013
Build your own clouds with Chef and MCollective
Masterless puppet
Puppet Camp Tokyo 2014: Why we stopped using Puppet Agent Daemon
Demystifying puppet
Puppet Camp DC 2014: Managing Puppet with MCollective
Introduction to orchestration using Mcollective
Continuous Deployment Applied at MyHeritage
PuppetConf track overview: Modern Infrastructure
11 Ways to Hack Puppet for Fun and Productivity - Luke Kanies - Velocity 2012
Ad

Similar to Write php deploy everywhere (20)

PPTX
Automated Deployment With Phing
PDF
Stress Free Deployment - Confoo 2011
KEY
Automating Web Application Deployment
PDF
Deploying PHP applications with Phing
PDF
Deployment Tactics
PDF
Building and deploying PHP applications with Phing
KEY
An introduction to Phing the PHP build system
PDF
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
PDF
Phing
KEY
An introduction to Phing the PHP build system (PHPDay, May 2012)
PPT
Build Automation of PHP Applications
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
PDF
Building and Deploying PHP apps with Phing
PPTX
Automation with phing
PPTX
Drupal & Continous Integration - SF State Study Case
PDF
Phing: Building with PHP
PPTX
Deploying PHP apps on the cloud
PDF
Build & deploy PHP application (intro level)
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
PDF
Building and Deploying PHP Apps Using phing
Automated Deployment With Phing
Stress Free Deployment - Confoo 2011
Automating Web Application Deployment
Deploying PHP applications with Phing
Deployment Tactics
Building and deploying PHP applications with Phing
An introduction to Phing the PHP build system
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Phing
An introduction to Phing the PHP build system (PHPDay, May 2012)
Build Automation of PHP Applications
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Building and Deploying PHP apps with Phing
Automation with phing
Drupal & Continous Integration - SF State Study Case
Phing: Building with PHP
Deploying PHP apps on the cloud
Build & deploy PHP application (intro level)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Building and Deploying PHP Apps Using phing

More from Michelangelo van Dam (20)

PDF
GDPR Art. 25 - Privacy by design and default
PDF
Moving from app services to azure functions
PDF
Privacy by design
PDF
DevOps or DevSecOps
PDF
Privacy by design
PDF
Continuous deployment 2.0
PDF
Let your tests drive your code
PDF
General Data Protection Regulation, a developer's story
PDF
Leveraging a distributed architecture to your advantage
PDF
The road to php 7.1
PDF
Open source for a successful business
PDF
Decouple your framework now, thank me later
PDF
Deploy to azure in less then 15 minutes
PDF
Azure and OSS, a match made in heaven
PDF
Getting hands dirty with php7
PDF
Zf2 how arrays will save your project
PDF
Create, test, secure, repeat
PDF
The Continuous PHP Pipeline
PDF
PHPUnit Episode iv.iii: Return of the tests
PDF
Easily extend your existing php app with an api
GDPR Art. 25 - Privacy by design and default
Moving from app services to azure functions
Privacy by design
DevOps or DevSecOps
Privacy by design
Continuous deployment 2.0
Let your tests drive your code
General Data Protection Regulation, a developer's story
Leveraging a distributed architecture to your advantage
The road to php 7.1
Open source for a successful business
Decouple your framework now, thank me later
Deploy to azure in less then 15 minutes
Azure and OSS, a match made in heaven
Getting hands dirty with php7
Zf2 how arrays will save your project
Create, test, secure, repeat
The Continuous PHP Pipeline
PHPUnit Episode iv.iii: Return of the tests
Easily extend your existing php app with an api

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Modernizing your data center with Dell and AMD
PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Spectroscopy.pptx food analysis technology
Advanced Soft Computing BINUS July 2025.pdf
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Modernizing your data center with Dell and AMD
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Review of recent advances in non-invasive hemoglobin estimation
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....

Write php deploy everywhere

Editor's Notes

  • #2: \n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: \n
  • #9: manual modifying on server\nno return to previous\nfailures visible\n\n
  • #10: \n
  • #11: local files &amp;#x201C;out-of-sync&amp;#x201D;\noverwriting code of others\nno previous version\n
  • #12: \n
  • #13: all go to a central (or decentral) repository\ncode is versioned\nwhen failure, you can revert\n
  • #14: snapshot tag -&gt; deployment package\n
  • #15: \n
  • #16: \n
  • #17: \n
  • #18: \n
  • #19: \n
  • #20: \n
  • #21: \n
  • #22: \n
  • #23: \n
  • #24: \n
  • #25: \n
  • #26: \n
  • #27: \n
  • #28: \n
  • #29: \n
  • #30: \n
  • #31: \n
  • #32: \n
  • #33: \n
  • #34: \n
  • #35: WA SDK: http://msdn.microsoft.com/en-us/windowsazure\n
  • #36: \n
  • #37: first create a package with 2 instances\nthan deploy to azure\n
  • #38: \n
  • #39: WA Manager\n- two instances\n
  • #40: \n
  • #41: perfect world\n
  • #42: \n
  • #43: layers: db, services\nplugins: caching solutions -&gt; OS detection\n
  • #44: when your boss asks you to deploy quickly\n- you might forget steps\ncomputers are good at doing repeated tasks\n- use that!\n
  • #45: if you&amp;#x2019;re interested in cloud deployment\n- phpa - Feb 2011 issue\n
  • #46: \n