9951 explained code solutions for 126 technologies


php-laravelHow can I use XAMPP to develop a project in Laravel with PHP?


XAMPP is a free and open-source cross-platform web server solution stack package developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB database, and interpreters for scripts written in the PHP and Perl programming languages. It can be used to develop projects in Laravel with PHP.

To use XAMPP to develop a project in Laravel with PHP, follow these steps:

  1. Download and install XAMPP on your computer.
  2. Start the Apache and MySQL modules in the XAMPP Control Panel.
  3. Create a database for your project in the phpMyAdmin interface.
  4. Install Composer, a dependency manager for PHP, on your computer.
  5. Create a new Laravel project using the command composer create-project --prefer-dist laravel/laravel projectname.
  6. Configure the .env file in the project folder with the database connection details.
  7. Run the project using the command php artisan serve.

Example code

composer create-project --prefer-dist laravel/laravel projectname

Output example

Installing laravel/laravel (v7.17.0)
  - Installing laravel/laravel (v7.17.0): Downloading (100%)
Created project in projectname

Helpful links

Edit this code on GitHub