Laravel安裝過程中遇到的幾個(gè)問題
1.安裝Homestead的過程中,在輸入cd~/Homestead&&vagrant up后
There was an error while executing `VBoxManage`, a CLI used by Vagrantfor controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "152cca03-0b0a-4e57-b501-b694821a2629", "--type", "headless"]
Stderr: VBoxManage.exe: error: The virtual machine 'homestead-7' has terminated unexpectedly during startup with exit code -1073741819 (0xc0000005).
解決方法:這種情況是vagrant 啟動(dòng)失敗,一般是VirtualBox出問題争剿。先試下能否在VirtualBox中啟動(dòng)其他虛擬機(jī)袁翁,如果不能就重裝VirtualBox
2.在將 SSH Key 添加到 ssh-agent 中時(shí)旬蟋,輸入
$eval`ssh-agent -s`
$ ssh-add ~/.ssh/id_rsa
遇到Could not open a connection to your authentication agent
解決方法:先運(yùn)行exec ssh-agent bash再eval ssh-agent -s最后ssh-add ~/.ssh/id_rsa
3.將公鑰添加到 GitHub 賬號(hào)陋守,輸入$ sudo apt-get install xclip? $ xclip -sel clip < ~/.ssh/id_rsa.pub來復(fù)制公鑰后遇到Can't open display: (null)
可以試一下 $DISPLAY=:0 xclip -sel clip < ~/.ssh/id_rsa.pub 來復(fù)制炫刷。如果還是無法復(fù)制橘原,可以$cat ~/.ssh/id_rsa.pub將公鑰輸出籍铁,手動(dòng)復(fù)制
4.第一次將生成的laravel文件推送到github前($gitremote add origingit@github.com:your_username/your_projectname.git
$gitpush -u origin master),要確保先$git init? $git add -A? $gitcommit -m"Initial commit" 將文件在虛擬機(jī)中保存趾断,不然會(huì)出現(xiàn)not a git repository的情況
5.linux 下執(zhí)行 php artisan help:commands 命令拒名,提示 Could not open input file: artisan 錯(cuò)誤
artisan 是 Laravel 項(xiàng)目下的指令文件,在Laravel 項(xiàng)目的根目錄下可以看到artisan文件芋酌。所以首先要建立 Laravel 項(xiàng)目增显。如果已經(jīng)建立項(xiàng)目需要CD到項(xiàng)目的目錄下執(zhí)行 artisan 命令。
6.在我們每次對homestead.yaml文件進(jìn)行了更改之后脐帝,都需要運(yùn)行下面命令來使其更改生效:cd~/Homestead&&vagrant provision
但是這個(gè)命令是在homestead下運(yùn)行的同云,不能在vagrant運(yùn)行
使用homestead執(zhí)行yarn add jquery --save命令報(bào)錯(cuò)
如果你正在 Windows 系統(tǒng)上開發(fā)糖权,需要在運(yùn)行yarn add jquery --save命令時(shí)帶上--no-bin-links:
即yarnadd jquery --save --no-bin-links