久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      WSL2配置laravel環(huán)境的方法

      下面由Laravel教程欄目給大家介紹WSL2配置laravel環(huán)境的方法,希望對(duì)需要的朋友有所幫助!

      WSL2配置laravel環(huán)境的方法

      參考:https://github.com/laravel/homestead/issues/1484

      windows上的vagrant的virtualbox版本在開啟wsl2之后會(huì)有奇怪的報(bào)錯(cuò)。。。hyperv版本又完全下不動(dòng)。正好homestead的維護(hù)者最近搞了個(gè)wsl2的一鍵安裝腳本,體驗(yàn)了一下好像還行。這里附上操作步驟。

      配置環(huán)境

      首先下載homestead的repo

      git clone https://github.com/laravel/homestead cd homestead git checkout 20.04 #切換至20.04分支

      然后運(yùn)行安裝腳本。

      sudo -E ./bin/wsl-init What is your WSL user name? # 輸入wsl的用戶名,軟件將安裝到該用戶名下 What is your WSL user group? (Same as username if you're unsure) # 輸入wsl的用戶群組名,一般和用戶名一樣

      腳本會(huì)自動(dòng)在wsl上安裝并配置好需要的軟件環(huán)境如php、mysql、nginx等。

      掛載網(wǎng)站

      安裝完成后,編輯Homestead.yaml文件,加入新配置項(xiàng)wsl_sites,語(yǔ)法格式和sites相同

      wsl_sites:         -   map: vcdt.test             to: /mnt/c/Users/halo/Code/vcdt/public

      接下來(lái),運(yùn)行

      ./bin/homestead wsl:create-sites

      配置文件會(huì)被自動(dòng)寫入nginx,此時(shí)訪問(wèn)127.0.0.1(或者編輯以下windows下的hosts文件后直接訪問(wèn)域名)應(yīng)該就能看到網(wǎng)站上線了。如果看不到的話,可以參考一下這篇文章,獲取wsl2虛擬機(jī)的ip之后再嘗試。

      遇到的一些問(wèn)題

      mysql密碼

      查看腳本發(fā)現(xiàn)配置和homestead虛擬機(jī)上一樣,用戶名為homestead,密碼為secret.

      網(wǎng)站響應(yīng)速度十分之慢

      這個(gè)我查了一下好像是wsl2文件io的問(wèn)題,訪問(wèn)windows盤的速度特別慢,而且暫時(shí)無(wú)解。可以看

      • Major performance (I/O?) issue in /mnt/* and in ~ (home)

      唯一的解決辦法就是把網(wǎng)站目錄放在wsl系統(tǒng)里……對(duì)比圖:
      wsl2目錄下:
      WSL2配置laravel環(huán)境的方法
      windows本地目錄:

      WSL2配置laravel環(huán)境的方法

      重啟后網(wǎng)站無(wú)法加載

      查了下好像是wsl2的service不會(huì)自動(dòng)開啟。。。這個(gè)只能手動(dòng)搞了,或者在.bashrc中寫入

      sudo service nginx restart sudo service php7.4-fpm restart sudo service mysql restart

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)