How to deploy a PHP website or application (2024)

At Launchdeck, we help developers automate their builds and deployments. Deployment is the process of uploading the application from your local machine or a source code repository (Git) to a server and making it available to users. In this article, we will show you how to easily deploy a PHP application to your server.

What goes into deploying a PHP application?

Every application is different, as is the process. During PHP deployment, the files are uploaded to your server with the following most common steps:

  • Clone the repository or checking out specific version of the application from the code repository
  • Download dependencies (Composer)
  • Compile assets (JavaScript, CSS, images) using tools like Gulp, Webpack, Grunt
  • Deploy code to server (FTP, SFTP, SSH)
  • Optional: Run shell commands on your server, like restarting services or running database migrations (SSH server only)

Launchdeck offers two distinct deployment strategies:

  • FTP and SFTP deployments:
    Upon first publish, all files will be uploaded one by one. For every subsequent publish, only files changed since the last version will be updated in-place on your server.
  • Atomic deployments:
    Fast, zero-downtime deployments requiring SSH access. Uploads the entire release as a single package and extracts it on the server. Once you hit publish, a symlink will be made to point to the new release. Find out more on how zero downtime atomic deployments work.

As we proceed, we'll assume you're familiar with Git and have all your application sources in a repository, except for compiled files and third party dependencies installed using a package manager.

The best way to deploy a PHP website or application

There are several ways to deploy a PHP website to your server. We’ve covered various ways in another article: "Different ways to deploy a website using Git". The most convenient and simple way is as follows:

Connect your Git repository to Launchdeck

The first step in deploying your PHP project is to connect the Git repository. You can easily connect a Github or Bitbucket account and choose from the list of repositories available within the account. Or if you're using a different Git provider, like Gitlab or a self-hosted server, you can choose the Private/Hosted Git server option.

How to deploy a PHP website or application (1)

All files within this repository are uploaded to your server. Launchdeck will also attempt to add a webhook to your repository so that when you push new commits, they'll show up in Launchdeck automatically. Depending on the deployment strategy you’re using, Launchdeck will upload either the files changed since the last version, or a fresh new release containing the new version in full (for atomic deployments).

Download dependencies and compile assets

Launchdeck allows you to define "build steps" using a simple YAML format. Hit the button “Auto suggest build automation” and we will automatically suggest a build config based on the contents of your repository. For a PHP application, such a configuration might look something like:

build: - composer install - npm install - gulp

More info: How to automate your build process

Deploy files to the server

All files from your repository and the files generated during the build phase can now be uploaded to the server via:

How to deploy a PHP website or application (2)

Optional: Run SSH commands on your server

In addition to the build commands, you may want to execute some commands on your server after every deployment. SSH commands are useful in a variety of situations, including:

  • Automatically running migration scripts after deploying a new version
  • Clearing application cache(s) when a new version goes live
  • Restarting a server process or service after uploading the latest sources

More info: Docs about SSH commands

Learn more

How to deploy a PHP website or application (2024)
Top Articles
London Vs. NYC: Which Has More Iconic Weather?
Achetez Facilement la Carte PCS chez les Bureaux de Tabac: Accessible et Pratique
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
O'reilly's Auto Parts Closest To My Location
Live Basketball Scores Flashscore
Pga Scores Cbs
Free Atm For Emerald Card Near Me
Southeast Iowa Buy Sell Trade
Wild Smile Stapleton
Mustangps.instructure
Bank Of America Appointments Near Me
Which aspects are important in sales |#1 Prospection
Find your energy supplier
De Leerling Watch Online
Facebook Marketplace Charlottesville
Idaho Harvest Statistics
Abortion Bans Have Delayed Emergency Medical Care. In Georgia, Experts Say This Mother’s Death Was Preventable.
Niche Crime Rate
Days Until Oct 8
ABCproxy | World-Leading Provider of Residential IP Proxies
At&T Outage Today 2022 Map
How to Watch Every NFL Football Game on a Streaming Service
6 Most Trusted Pheromone perfumes of 2024 for Winning Over Women
55Th And Kedzie Elite Staffing
Divide Fusion Stretch Hoodie Daunenjacke für Herren | oliv
Garden Grove Classlink
Bolly2Tolly Maari 2
Harrison 911 Cad Log
Best Town Hall 11
10-Day Weather Forecast for Santa Cruz, CA - The Weather Channel | weather.com
Craftsman Yt3000 Oil Capacity
Best Laundry Mat Near Me
Funky Town Gore Cartel Video
Rust Belt Revival Auctions
Puretalkusa.com/Amac
Jr Miss Naturist Pageant
Greater Keene Men's Softball
Robeson County Mugshots 2022
Craigslist Summersville West Virginia
Craigslist Pets Huntsville Alabama
Uc Santa Cruz Events
Conan Exiles Armor Flexibility Kit
La Qua Brothers Funeral Home
The Average Amount of Calories in a Poke Bowl | Grubby's Poke
Zits Comic Arcamax
R Detroit Lions
Craigslist Monterrey Ca
Gelato 47 Allbud
Mazda 3 Depreciation
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 6304

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.