How to Create a Laravel 11 Project With XAMPP and Visual Studio Code

Last update: 05-03-2024

Setting up a new Laravel 11 project on Windows 11 is a straightforward process if you follow these steps. This guide uses XAMPP, Composer, and Visual Studio Code.

1. Install XAMPP

Begin by downloading XAMPP for Windows from Apache Friends. Run the installer and it's advisable to install it in the default directory, C:xampp.

2. Install Composer

Next, download the Composer installer from Composer's Official Site. During installation, ensure that Composer can locate your PHP installation. If it doesn't automatically find it, navigate to C:XAMPPphp and select php.exe. Remember to check the option to "Add this PHP to your path" during setup.

After installing Composer, it's recommended to sign out and back into Windows to ensure path changes take effect.

3. Install Visual Studio Code

Download and install Visual Studio Code from Visual Studio Code

4. Verify Installation

Open Visual Studio Code, then open the built-in terminal from the menu by navigating to Terminal → New Terminal.

In the terminal, navigating to the htdocs folder:

cd
cd xampphtdocs

And ensure that PHP and Composer are accessible:

php --version
composer --version

5. Enable PHP Zip Extension

Open C:xamppphpphp.ini in Notepad, find the line ;extension=zip, and uncomment it by removing the semicolon at the beginning.

6. Create Laravel Project

Back in the terminal, create your Laravel project by running:

composer create-project laravel/laravel php-awesome

This will take about 2 minutes to complete.

7. Open Project

In Visual Studio Code, open the project folder by selecting File → Open Folder. Navigate to C:XAMPPhtdocsphp-awesome and click "Select Folder". Trust the authors if prompted.

8. Serve the Application

To serve your new Laravel application, run the following command in the built-in terminal:

php artisan serve

You can now access your application at localhost:8000.

By following these steps, you'll have a Laravel 11 project up and running on your Windows 11 system, ready for further development.

StocksComparison.com ad
 

0 Comments

Add a new comment: