How To Install Laravel on Windows
source link: https://code.tutsplus.com/tutorials/how-to-install-laravel--cms-93381
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How To Install Laravel on Windows
Read Time: 4 min
Laravel is a PHP framework that is used to build Laravel applications. Before you create your first application with Laravel, make sure you have PHP and Composer installed. Composer is used to install Laravel. In this post, I will show you how to install Laravel from start to finish.
Setting Up a Laravel Environment
There are different ways to install Laravel on your machine, and your choice depends on your operating system. Laravel provides detailed documentation on the different options. The official recommendation is to use Docker Desktop, but in this lesson we'll be using XAMMP to install PHP and then we'll set up Laravel manually.
Steps for Installing Laravel
The installation of Laravel can be achieved in 3 easy steps:
Watch this video for a complete guide:
In order to build Laravel applications, we first need to install PHP and MySQL on our machine.
How to Install XAMPP on Windows
In order to build Laravel applications, we need to install PHP and MySQL on our machine. The easiest way to install PHP on Windows is through XAMPP. It is available on all three desktop operating systems—Windows, Linux, and Mac. However, on Mac it's best to use MAMP, which is compatible with the new M1 and M2 chips.
Now let's take a look at how to install XAMMP on Windows.
Go to https://www.apachefriends.org/download.html and download the installer for your operating system. Select the latest version of PHP, ie. the one at the bottom of the list.
1. Install Wizard
Double click the installer then follow the prompts.
2. Installer Settings
You won’t need to change any of the installation settings, the defaults are all good as is.
3. Installation Folder
Of particular note, you should leave the installation drive as the C:\
drive on Windows in order for things to function correctly.
You may also need to grant approval for XAMPP’s Apache installation to have network access through Windows Defender or any other firewall you might be running.
4. Gate Fold
Continue following the prompts. When the installation is complete, leave the option checked that says Do you want to run the Control Panel now?, then close the installer and you’ll see the XAMPP Control Panel appear.
If you missed the chance to leave that box checked, just run XAMPP from your list of installed software to start the Control Panel.
How To Install Composer
Once you have PHP installed on your system, it's easy to install Composer. First, download it from the Composer website.
1. Install Composer
Click on the downloaded Composer-Setup.exe file (for Windows) or the equivalent for your operating system. Run the installer and it will install the latest composer version.
2. Adjust the System Path
Add the PHP executable to your system path using the installer.
3. Proxy Server Setup
If you don't have a proxy server, just click Next.
4. Install
Composer is now ready to install and the setup wizard will download files on to your machine.
5. Test
You want to be sure that Composer will run without hitches.
Open the command prompt or terminal.
type and run the command composer --version
. You should see the current Composer version printed to the terminal.
How To Install Laravel
1. Open the Terminal
Now that you have installed PHP and Composer. Creating Laravel is straightforward. Open your terminal.
2. Create a Laravel Project
Run the command below to create a brand new project inside a folder named my-app (or any project name you wish):
composer create-project laravel /laravel my-app |
This will download all the necessary Laravel files for this project
3. Start the Development Server
After the application has been created, cd into my-app and start your development server using the following commands:
cd my-app php artisan serve |
4. Browse to Your New Laravel App
We are done setting up the environment. You should be able to access your Laravel development server at https://localhost:8000
Next Steps
That's it, you've successfully installed Laravel and run your first app. But this is just the beginning! Now you can learn to build websites and apps with this powerful and easy-to-use framework. Get started with our complete guide to learning Laravel.
Learn Laravel With a Free Online Course
The best way to get started learning Laravel is with a free course from Envato Tuts+.
Get Started With Laravel
Want to learn Laravel from start to finish? Watch this comprehensive free course! Join Jeremy McPeak as he teaches you everything you need to get started with Laravel.
Franc Lucas is a code and web design instructor for Tuts+. A freelance writer with nearly 200 tutorials published to date, Franc's goal is to help users discover great technologies that allow their websites and online stores to deliver maximum value to customers.
He has worked in art publishing and communications. In addition to reading and writing about new technologies, he enjoys exploring the possibilities of HTML, CSS, and Python. In his free time, you'll find him immersed in photography and exploring new cities.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK