安装laravel5.7+时,需要安装一大堆依赖包,如果php扩展没有开启就会报错,如图
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for league/flysystem 1.0.55 -> satisfiable by league/flysystem[1.0.55].
- league/flysystem 1.0.55 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
Problem 2
- league/flysystem 1.0.55 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- laravel/framework v5.8.33 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.55].
- Installation request for laravel/framework v5.8.33 -> satisfiable by laravel/framework[v5.8.33].
To enable extensions, verify that they are enabled in those .ini files:
- C:\phpStudy\PHPTutorial\php\php-7.2.1-nts\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
此时的解决办法只有打开php.ini配置文件 开启 extension=php_fileinfo.dll扩展即可!
创建完项目后,记得复制.env.example -》 .env
紧接着又报错:No application encryption key has been specified. 百度了一下这个是由于没有配置好 APP_KEY 这又是个什么鬼?
在项目目录下 运行 php artisan key:generate
D:\php>cd laravel
D:\php\laravel>php artisan key:generate
Application key set successfully.
D:\php\laravel>
完美!