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
How to Enable 2-Step Verification for Call of Duty
How SoFi Works
Poe T4 Aisling
Somboun Asian Market
Rek Funerals
Bucks County Job Requisitions
Free VIN Decoder Online | Decode any VIN
The Idol - watch tv show streaming online
Fototour verlassener Fliegerhorst Schönwald [Lost Place Brandenburg]
Kent And Pelczar Obituaries
Campaign Homecoming Queen Posters
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Lake Nockamixon Fishing Report
Dignity Nfuse
Cyndaquil Gen 4 Learnset
Soccer Zone Discount Code
Spergo Net Worth 2022
Swgoh Turn Meter Reduction Teams
The Exorcist: Believer (2023) Showtimes
Saatva Memory Foam Hybrid mattress review 2024
Nordstrom Rack Glendale Photos
Halo Worth Animal Jam
Breckie Hill Mega Link
Marion City Wide Garage Sale 2023
Lost Pizza Nutrition
Lexus Credit Card Login
Craig Woolard Net Worth
Is Light Raid Hard
Cowboy Pozisyon
Sensual Massage Grand Rapids
Delta Math Login With Google
Wells Fargo Bank Florida Locations
Pixel Combat Unblocked
Warren County Skyward
Solarmovie Ma
Gideon Nicole Riddley Read Online Free
Craigslist Neworleans
Missouri State Highway Patrol Will Utilize Acadis to Improve Curriculum and Testing Management
Colorado Parks And Wildlife Reissue List
Pillowtalk Podcast Interview Turns Into 3Some
The Vélodrome d'Hiver (Vél d'Hiv) Roundup
Emerge Ortho Kronos
Body Surface Area (BSA) Calculator
Lake Andes Buy Sell Trade
Lyndie Irons And Pat Tenore
13 Fun & Best Things to Do in Hurricane, Utah
How to Connect Jabra Earbuds to an iPhone | Decortweaks
Dicks Mear Me
Theater X Orange Heights Florida
Naughty Natt Farting
Ff14 Palebloom Kudzu Cloth
Famous Dave's BBQ Catering, BBQ Catering Packages, Handcrafted Catering, Famous Dave's | Famous Dave's BBQ Restaurant
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.