Install PHP

(1) Download PHP. It is recommended to use version 7.4 or later. The NTS version (not thread-safe) can be selected if the server uses Fast CGI.

Windows.php.net/downloads/r…

(2) unzip to a directory without Chinese, without Spaces.(three) enter the directory, willphp.ini-developmentMake a copy of the document and rename it tophp.ini.

  • willphp.iniIn theextension_dirFind, remove;Comment out and change the directory to your own. Specifies the PHP extension library directory.

  • willcgi.fix_pathinfoComment out. Enables Nginx to integrate with Fast CGI.

  • Add any extensions you needextension= + The libraryThis library should be placed in the ext directory. I will be herefileinfo(guess the file content type and encoding),mbstring(encoding and byte handling) andopensslThe (symmetric/asymmetric encryption and decryption) module is enabled.

To view the PHP version, run PHP -v in the PHP directory. For convenience, you can add a directory to your environment variable (the directory that contains php.exe).

Install composer

You can download the installer directly from the official website and proceed to the next step. If the command line input composer has normal feedback, it is already installed.

getcomposer.org/download/

To download dependencies faster, use the following command to change the source:

Disable the default source
composer config -g secure-http false
# Change to Ariyuan
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
# Check the configuration
composer config -g -l
Copy the code

Three, install laravel

Install laravel installer:

# Composer download laravel installer
composer global require "laravel/installer"
Check the installer version
laravel -V
Copy the code

Install nginx

  • Download the nginx.
  • Unzip to a directory with no Chinese and no Spaces.
  • To configure nginx.conf, do the following:

Change the resource directory to add PHP file support and display the directory if there is no match. Next uncomment the following snippet and put/scriptReplace it with the root directory.Create the index.php file in the resources directory, then launch and accesslocalhostCheck for success (starting php-CGI and nginx at the same time).

Success will be displayed as follows.

  • Start the nginx.
    • start nginx
  • Close all nginx processes.
    • taskkill /im nginx.exe /f
  • Start the PHP – cgi.
    • php-cgi -b 9000 -c php.ini