Instantly install PHP and Laravel

October 11, 2024 (Today)

Command

Prior to starting your first Laravel project, make sure you have installed Composer and PHP. For someone who is new, it could be a little tiresome if these are not already installed. Don't worry, though; the Laravel team has you covered and has simplified and streamlined the procedure in response to feedback. A new addition to the official documentation is a one-line command that will do everything for you. It is quite easy to set up on Windows, Linux, or macOS.

If you're using macOS, simply run:

/bin/bash -c "$(curl -fsSL https://php.new/install/mac"

If you're using Windows, simply run:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://php.new/install/windows'))

And on Linux:

/bin/bash -c "$(curl -fsSL https://php.new/install/linux)"

These commands handle the background tasks of downloading and setting up your environment for PHP, Composer, and Laravel. And that's it! You're ready to begin using Laravel and PHP.