之因此學習他是由於最近換了電腦 又要從新搭環境 很煩躁而後就有了而後php
1.先安裝 virtualbox
2.安裝 vagrant
3.安裝xshell
4.重啓
5.下載系統鏡像 (能夠去vagrant官網下載)
6.進入到鏡像目錄 執行 vagrant box add 名字 鏡像名字
7.查看有沒有box vagrant box list
8.初始化鏡像 vagrant init 名字
9 開始虛擬機 vagrant up
10 登陸 虛擬機 使用xshell登不進去 使用windows cmd 登陸html
11.共享文件nginx
Vagrantfile增長配置shell
config.vm.network :private_network, type:"dhcp"
config.vm.synced_folder "D:/phpstudy/PHPTutorial/WWW/aa", "/aa" 前面路徑是本地路徑 後面路徑是虛擬機路徑
掛載過報錯:mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
mount: unknown filesystem type 'vboxsf'
解決辦法:
vagrant plugin install vagrant-vbguest
vagrant reload --provision
12.打包分發
vagrant package --output ubuntu.box 後面ubuntu.box 是打包的名字
安裝php+nginx環境
nginx安裝教程:http://www.javashuo.com/article/p-xqngepif-bo.html
php7.2 安裝教程http://www.javashuo.com/article/p-xufoecyh-n.html
安裝swoole擴展
好一頓折騰
教程 https://wiki.swoole.com/wiki/page/6.html
截圖這個準備好。
sudo /usr/local/php/bin/phpize 這裏要寫絕對路徑執行
sudo ./configure --with-php-config=/usr/local/php/bin/php-config 這裏同上 ubuntu
上面兩步很關鍵windows
swoole安裝好以後重啓php-fpm就能看到了未完待續。。。。。。。。。。。