2021-12-01

安装本地php环境

--查询php版本
brew search php
--选择安装7.4
brew install [email protected]
--根据安装提示运行
If you need to have [email protected] first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"


--加入到服务中
brew services start [email protected]
--新开窗口
php -v
--安装composer
brew install composer

新建一个Laravel项目backend

1、不通过composer

curl -s https://laravel.build/backend | bash
--根据提示
cd backend && ./vendor/bin/sail up
--报错(应该是要改镜像,后面待研究)
 Get "https://registry-1.docker.io/v2/": context deadline exceeded

2、通过composer

composer create-project laravel/laravel backend1

你可能感兴趣的:(2021-12-01)