Home > PHP Framework > Laravel > body text

Let's talk about how to install and use Laravel on Windows

PHPz
Release: 2023-03-31 16:27:47
Original
1025 people have browsed it

Running Laravel on the windows platform requires installing the environment first, including PHP, Composer and some extensions. Below are step-by-step installation instructions to help you get started using Laravel on Windows.

Download and install PHP

  1. Open [PHP official website](https://windows.php.net/download/) Download the Windows version of PHP (select the x64 Thread Safe version) .
  2. Extract the downloaded PHP compressed package to the root directory of drive C (you can also extract it to any other directory), for example: C:\php.
  3. Find the php.ini-development file in the PHP directory, copy it and rename it to php.ini.
  4. Remove the comment character (;) before the following two lines in the php.ini file:

    extension_dir = "ext"
    extension=php_mbstring.dll
    Copy after login
  5. Remove the # in the PHP directory ##php.exe and php.ini are added to the system environment variables. Open "Control Panel" > "System" > "Advanced System Settings" > "Environment Variables", find "Path" in the system variable list, and add C:\php (here you need to follow Modify according to your own situation).
  6. Open the command prompt (Windows R key, enter "cmd" and press Enter), enter
  7. php -v, if the PHP version information can be output normally, the PHP installation is successful.
Download and install Composer

    Open [Composer official website](https://getcomposer.org/download/) Download the Windows version of Composer (select the Windows Installer version) .
  1. Open the downloaded installation package and follow the prompts to install Composer.
  2. Open the command prompt and enter
  3. composer -V. If the Composer version information can be output normally, the Composer installation is successful.
Installing Laravel

    Open the command prompt, enter
  1. composer global require "laravel/installer", and wait for the installation to complete.
  2. Enter
  3. laravel -V, if the Laravel version information can be output normally, Laravel is installed successfully.
  4. Open a command prompt in any directory, enter
  5. laravel new myproject (where myproject is the name of the created project), and wait for the project download and installation to complete.
Run Laravel

    Switch to the project directory in the command prompt and enter
  1. cd myproject (where myproject is the name of the created project).
  2. Enter
  3. php artisan serve to start Laravel’s built-in web server.
  4. Open the browser and visit [http://localhost:8000](http://localhost:8000) to see the Laravel welcome page.
The above are the detailed steps for installing Laravel on the Windows platform. Hope this article is helpful to you.

The above is the detailed content of Let's talk about how to install and use Laravel on Windows. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!