当前位置:网站首页>Homestead environment setup

Homestead environment setup

2022-06-13 08:18:00 Parthenocissus still works

according to laravel Community document steps , install VirtualBox, install Vagrant, download Homestead And import Homestead Box, install git, download Homestead Manage scripts (git clone https://git.coding.net/summerblue/homestead.git Homestead) And initialize (bash init.sh),Homestead.yaml The configuration file can be modified ip, Site services , database ,ssh Key login , Shared file configuration, etc , Refer to the documentation for details .

Good configuration Homestead.yaml File, you can start vagrant 了 (vagrant up), adopt vagrant ssh Sign in vagrant, But here's a question : The built environment lacks redis and mongo. The document says that these should be installed by default , Later on Homestead.yaml In the configuration features: Combined with the redis and mongodb, It still doesn't work ( I look forward to hearing from my friends ).

Go to the site directory (~/Code) Download laravel Source code , Various errors are reported during downloading . Check the document and switch to composer Source :

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

Then download again :

composer create-project --prefer-dist laravel/laravel blog

It's a success this time , Occasionally, sometimes composer The failure of the update command may be caused by the poor network , Just execute it again .

According to the site name and nginx Configure and set up the site , Directory and local hosts After the document , Visit Site http://homestead.test, Tips 500 Error. Check that all necessary services are started normally . see nginx Error log ,PHP Fatal error: Declaration of TranslatorInterface::setLocale($locale) must be compatible with LocaleAwareInterface::setLocale(string $locale), Seems to follow php of , I have tried several times to locate php On the issue of version . stay shell perform php Is, indeed, php7.4 But in laravel Printed out in the code php The version is 7.1, stay Homestead.yaml Add... Under site configuration php:"7.4" Restarting still doesn't work , Finally, manually in nginx The configuration file has been modified fastcgi_pass by 7.4. heavy load nginx To configure . Refresh the browser and the website displays normally .

 

原网站

版权声明
本文为[Parthenocissus still works]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270544564229.html