Let's talk about how to install and use Laravel on Windows
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
- Open [PHP official website](https://windows.php.net/download/) Download the Windows version of PHP (select the x64 Thread Safe version) .
- 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. - Find the
php.ini-developmentfile in the PHP directory, copy it and rename it tophp.ini. -
Remove the comment character (;) before the following two lines in the
php.inifile:extension_dir = "ext" extension=php_mbstring.dll
- Remove the # in the PHP directory ##php.exe
andphp.iniare added to the system environment variables. Open "Control Panel" > "System" > "Advanced System Settings" > "Environment Variables", find "Path" in the system variable list, and addC:\php(here you need to follow Modify according to your own situation).Open the command prompt (Windows R key, enter "cmd" and press Enter), enter - php -v
, if the PHP version information can be output normally, the PHP installation is successful.
- Open [Composer official website](https://getcomposer.org/download/) Download the Windows version of Composer (select the Windows Installer version) .
- Open the downloaded installation package and follow the prompts to install Composer.
- Open the command prompt and enter
- composer -V
. If the Composer version information can be output normally, the Composer installation is successful.
- Open the command prompt, enter
- composer global require "laravel/installer"
, and wait for the installation to complete.Enter - laravel -V
, if the Laravel version information can be output normally, Laravel is installed successfully.Open a command prompt in any directory, enter - laravel new myproject
(where myproject is the name of the created project), and wait for the project download and installation to complete.
- Switch to the project directory in the command prompt and enter
- cd myproject
(where myproject is the name of the created project).Enter - php artisan serve
to start Laravel’s built-in web server.Open the browser and visit [http://localhost:8000](http://localhost:8000) to see the Laravel welcome page.
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!
Hot AI Tools
Undress AI Tool
Undress images for free
Undresser.AI Undress
AI-powered app for creating realistic nude photos
AI Clothes Remover
Online AI tool for removing clothes from photos.
Clothoff.io
AI clothes remover
Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!
Hot Article
Hot Tools
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
Hot Topics
1793
16
1736
56
1587
29
267
587
Selecting Specific Columns | Performance Optimization
Jun 27, 2025 pm 05:46 PM
Selectingonlyneededcolumnsimprovesperformancebyreducingresourceusage.1.Fetchingallcolumnsincreasesmemory,network,andprocessingoverhead.2.Unnecessarydataretrievalpreventseffectiveindexuse,raisesdiskI/O,andslowsqueryexecution.3.Tooptimize,identifyrequi
Caching Strategies | Optimizing Laravel Performance
Jun 27, 2025 pm 05:41 PM
CachinginLaravelsignificantlyimprovesapplicationperformancebyreducingdatabasequeriesandminimizingredundantprocessing.Tousecachingeffectively,followthesesteps:1.Useroutecachingforstaticrouteswithphpartisanroute:cache,idealforpublicpageslike/aboutbutno
Creating Custom Validation Rules in a Laravel Project
Jul 04, 2025 am 01:03 AM
There are three ways to add custom validation rules in Laravel: using closures, Rule classes, and form requests. 1. Use closures to be suitable for lightweight verification, such as preventing the user name "admin"; 2. Create Rule classes (such as ValidUsernameRule) to make complex logic clearer and maintainable; 3. Integrate multiple rules in form requests and centrally manage verification logic. At the same time, you can set prompts through custom messages methods or incoming error message arrays to improve flexibility and maintainability.
How do I use Laravel's built-in authentication scaffolding? (php artisan ui bootstrap/vue/react --auth)
Jun 25, 2025 pm 05:20 PM
TosetupLaravel’sbuilt-inauthenticationscaffolding,ensureyouareusingacompatibleversionsuchasLaravel8orearlier,theninstalltheUIpackageviaComposerifnecessary.Next,generatetheauthviewswithBootstrap,Vue,orReactusingthephpartisanuicommand,followedbycompili
Artisan Console Commands | Developer Productivity Tools
Jun 27, 2025 pm 05:43 PM
Laravel's Artisan command line tool improves development efficiency through code generation, database management, custom commands and debug optimization. 1. Use make:* series commands to quickly generate controller, model, middleware and other files, and support resource controllers and single action controllers. 2. Manage database structure and data through commands such as migrate, db:seed, etc., and supports migration rollback and reset. 3. Use make:command to create a custom Artisan command and combine task scheduling to implement timing operations. 4. Use route:list, config:clear and other commands to debug and perform performance optimization to help troubleshoot configuration and caching problems.
Working with pivot tables in Laravel Many-to-Many relationships
Jul 07, 2025 am 01:06 AM
ToworkeffectivelywithpivottablesinLaravel,firstaccesspivotdatausingwithPivot()orwithTimestamps(),thenupdateentrieswithupdateExistingPivot(),managerelationshipsviadetach()andsync(),andusecustompivotmodelswhenneeded.1.UsewithPivot()toincludespecificcol
Adding multilingual support to a Laravel application
Jul 03, 2025 am 01:17 AM
The core methods for Laravel applications to implement multilingual support include: setting language files, dynamic language switching, translation URL routing, and managing translation keys in Blade templates. First, organize the strings of each language in the corresponding folders (such as en, es, fr) in the /resources/lang directory, and define the translation content by returning the associative array; 2. Translate the key value through the \_\_() helper function call, and use App::setLocale() to combine session or routing parameters to realize language switching; 3. For translation URLs, paths can be defined for different languages through prefixed routing groups, or route alias in language files dynamically mapped; 4. Keep the translation keys concise and
What are the system requirements for running Laravel?
Jun 26, 2025 am 10:51 AM
Laravelrequiresspecificsystemrequirementsforsmoothoperation.Firstly,itneedsPHP>=8.1forLaravel10andabove,withrequiredextensionslikeOpenSSL,PDO,bstring,Tokenizer,XML,Ctype,JSON,andBCMath.OlderLaravelversionsmaysupportPHP7.3 .Secondly,whileLaravelhas


