1, Win10 environment construction

A. Configure the native Composer command line environment

Download php:https://windows.php.net/downloads/releases/php-7.4.8-nts-Win32-vc15-x64.zip, and composer: https://github.com/composer/composer/releases/download/1.10.9/composer.phar, configuration, environment variables, easy to use composer command-line environment code composer. Bat:

@php "%~dp0composer.phar" config -g repo.packagist composer https://mirrors.aliyun.com/composer/

B.Vagrant installation environment

First test Homestead: Initialize the Homestead environment, Thunderbolt download: https://vagrantcloud.com/laravel/boxes/homestead/versions/10.0.0/providers/virtualbox.box

Vagrant Box Add -- Name Homestead /10.0 Homestead_VirtualBox. Box Vagrant Box List # Check

Go to the installation directory: D:\WorkPlace\wwwroot to create the Vagrantfile file:

Vagrant. Configure (" 2 ") do | config | config. The vm. The box = "favored / 10.0" config. The vm. The hostname = "favored" config.vm.net work Config.vm.net work "forwarded_port", guest: 8080, host: 80, host_ip: "127.0.0.1", guest: 8080, host: Config.vm.net work "forwarded_port", guest: 9501, host: 9501, host_ip: "127.0.0.1" config. SSH. Password = "123456" config. The vm. The provider "virtualbox" do | | vb vb. The memory = "2048" vb. The cpus = 4 end end

Switch the root directory to the current root directory, or a subdirectory of the root directory, and start the virtual machine using PHPStorm:

vagrant up

C. ginx and network tools

Vagrant SSH # add sudo configuration file vim/etc/nginx/conf. D/nginx. Conf # speed limit limit_req_zone $binary_remote_addr zone = mylimit: 10 m rate=100r/s; server { listen 80; server_name local.com; location / { root /vagrant; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { limit_req zone=mylimit burst=1000 nodelay; root /vagrant; fastcgi_index index.php; Fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name; $fstcgi_script_name /vagrant$fstcgi_script_name /vagrant$fstcgi_script_name /vagrant$fstcgi_script_name; include fastcgi_params; }}

Install.net – tools

sudo apt-get install net-tools util-linux -y
sudo nginx -s reload
netstat -lunpt

Visit http://127.0.0.1:8080/ for testing and you can see the NGINX page.

D. Traditional framework startup

Start laravel from the command line

Using document

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
mkdir /vagrant/framework && cd /vagrant/framework
composer create-project --prefer-dist laravel/laravel && cd laravel

Change the initial password:

DB_USERNAME=homestead
DB_PASSWORD=secret

Start the test

# note that host is 0.0.0.0, listening all the PHP artisan serve - host = 0.0.0.0 - port = 8080 & sudo netstat lunpt | grep 8080 # kill 9 4085

To test it, visit http://127.0.0.1:8080/, OK.

Use FPM to access static PHP files
# see vim/etc/PHP / 7.4 / FPM/pool. D/www.conf forwarding listening situation fastcgi_pass 127.0.0.1:9000; = = > fastcgi_pass Unix: / run/PHP/php7.4 - FPM. The sock. Ps - ef | grep PHP - FPM # sudo kill 9 sudo/usr/sbin/PHP - fpm7.4

Test to http://127.0.0.1:8080/index.php, OK.

2. Install Swoole and phpMyAdmin

A.o penssl + swoole,hyperfThe installation

Composer require swoole/ id-helper-v is already built in

Swoole and OpenSSL extensions installed

CD/opt sudo wget https://www.php.net/distributions/php-7.4.8.tar.xz sudo tar - Jxf PHP - 7.4.8. Tar. Xz CD PHP -7.4.8/ext/openssl ==> sudo cp config0.m4 config.m4 sudo./configure --with-openssl --with-php-config= => sudo apt-get install pkg-config sudo make && make install sudo pecl --with-php-config= => sudo apt-get install pkg-config sudo make && make install sudo pecl Sudo pecl install swoole sudo vim /etc/php/7.4/cli/php.ini EnableOpenSSL,swoole extension, swoole.use_shortName =0

Temporarily the installation was not successful using the following successful

cd /vagrant/framework #composer config -g --unset repos.packagist git clone https://github.com/hyperf/hyperf-skeleton.git CD hyperf - skeleton composer install - VVV cp. Env. Example. Env # modified database information, start

Phpmyadmin b.d ocker environment

Since this example failed to install Git and Composer to install PMA, Docker image was used. https://docs.docker.com/engine/install/ubuntu/ note that complete reboot

Docker Network Create MyBridge -- Subnet =172.1.0.0/16 Docker Network Create Others -- Subnet =111.0.0.0/8 # 10.0.2.15 Vagrant native IP docker pull phpMyAdmin/phpMyAdmin docker run-d --name pma \ --restart=always \ --network= myBridge -- IP =172.1.112.11 \ -e PMA_HOST=10.0.2.15 \ phpMyAdmin/phpMyAdmin

Nginx configures the proxy_pass proxy to the container at this fixed address

limit_req_zone $binary_remote_addr zone=mylimit:10m rate=100r/s; Localhost server {listen 80; localhost server {listen 80; localhost server {listen 80; server_name localhost; limit_req zone=mylimit burst=1000 nodelay; Location / {proxy_pass http://172.1.112.11:80/; }} Log on to phpMyAdmin using Homestead/secret

3. Use the Pagoda Linux panel environment

Pagoda has a very good UI, the late operation and maintenance advantages are obvious.

A. Installation of pagodas

Centos8 is the most compatible image, so use the Centos8 image.

# vagrant add generic/centos8 download https://vagrantcloud.com/generic/boxes/centos8/versions/3.0.20/providers/virtualbox.box Vagrant box add - name centos8 virtualbox. Box # add Vagrantfile files vagrant. Configure (" 2 ") do | config | config. The vm. The box = "centos8" config.vm.hostname = "centos8" config.vm.synced_folder ".. /", "/wwwroot/" config.vm.network "private_network", ip: "192.168.1.11" config. The vm. The provider "virtualbox" do | | vb vb. The memory = "6072" vb. The cpus = 4 end config. SSH. Password = "123456" # Default Vagrant config.vm.provision "shell", inline: <<-SHELL sudo su && sed -i "s/PasswordAuthentication no/# PasswordAuthentication no/" "/etc/ssh/sshd_config" && systemctl restart sshd SHELL end

6GB of memory is required by MySQL8.0 prompt.

Yum install wget - y && wget - O the sh http://download.bt.cn/install/install_6.0.sh && sh the sh f - 27220 Bt - Panel: http://153.34.17.147:8888/010ccdd8 username: qxcastvz password: ce309bd3

Complete adding port, Vagrant Reload

CONFIG.vm.net work "forwarded_port", guest: 8888, host: 8888, host_ip: "127.0.0.1"

Open http://127.0.0.1:8888/010ccdd8/

B. Install the environment and plug-ins

After restarting the port, use Quick Install to install LNMP.

Switch to the main PHP version
sudo ln -sf /www/server/php/74/bin/php /usr/bin/php
Read the permissions folder *
open_basedir = "/wwwroot/:/www/:/tmp/:/proc/"

Set it in the Settings of the appropriate PHP version. Or just comment this out. This is the main reason for all kinds of inexplicable errors in the composer install.

C. Fort Tower Terminal

https://download.bt.cn/ssh/BT-Term.exe Redis installation, uninstall reshipment doesn’t work.