当前位置:网站首页>Laravel框架安装时遇到的坑
Laravel框架安装时遇到的坑
2022-07-02 16:12:00 【北门牧野】
一、安装composer,我这边是虚拟的Linux系统,所以安装方式有两种:
1.是composer官方给的方法
2.是curl安装。
遇坑的地方就是curl安装的composer,安装完之后需要安装laravel框架
composer create-project --prefer-dist laravel/laravel
但是出现了curl 60报错,如下图
翻了很多解决办法,最后发现了一个能用的,就是下载证书,然后把证书放到指定的文件夹下。
-----下载证书地址:https://curl.se/docs/caextract.html 进入网站之后点击顶部的cacert.pem进行下载。
-----通过命令查看证书位置执行下面的命令,
php -r "print_r(openssl_get_cert_locations());"
-----得到本地证书的位置,如下图
-----找到phpini文件修改里面的内容如下图,修改完成后记得重启一下php

如果一切顺利,到此就可以正常安装Laravel了,当然也有可能遇到以下报错



以上报错的解决办法就是更换composer的镜像源。。。。。希望你能成功!
**
二、使用composer安装好laravel项目之后,就要安装laravel-ide-helper插件了,这里遇到的坑也挺多。
**
composer require barryvdh/laravel-ide-helper 2.6
这个插件的版本要和laravel框架版本吻合,不然会报错,即在执行php artisan ide 时提示
此时需要到框架的vendor目录下看看是否有barryvdh,如果没有那就再执行一次
composer require barryvdh/laravel-ide-helper 2.6
刚好我这里下载的是2.6版本的,所以,应该是吻合的,建议在composer.json中加入红框处内容
"barryvdh/laravel-ide-helper": "^2.6"

至此再执行
php artisan ide
就正常了
然后执行
php artisan ide-helper:gen
lavavel项目那里就会出现下图所示的内容,这时候就可以愉快的享受代码补全了。

如果此文章对你有用,那就太好了。
边栏推荐
- easyAI笔记——机器学习
- Larvel document reading notes custom authentication login and registration using larvel 8
- Modbus协议通信异常
- Taiwan Feiling fm8pb513b MCU provides MCU program development product design
- Atcoder beginer contest 237 VP supplement
- Wasserstein slim gain with clipping penalty (wsgain-cp) introduction and code implementation -- missing data filling based on generating countermeasure network
- Modbus protocol communication exception
- 体验一下阿里云文字识别OCR
- Linux中,mysql设置job任务自动启动
- 【Golang | gRPC】使用openssl生成证书
猜你喜欢

Explain kubernetes network model in detail

MySQL进阶-事务及索引

Modbus协议通信异常

Embedded ~ introduction

The price is only 40 yuan. Pico development board of raspberry pie is added with WiFi module, and it is out of stock as soon as it comes into the market

Outsourcing for five years, abandoned

体验一下阿里云文字识别OCR

1288_FreeRTOS中vTaskResume()接口以及中断安全版本接口实现分析

Modbus protocol communication exception

ASEMI整流桥UMB10F参数,UMB10F规格,UMB10F封装
随机推荐
Mb10m-asemi rectifier bridge mb10m
Pfc232-sop8/14/16 should be wide-ranging and can be tape programmed with burning program
What is the experience of maintaining Wanxing open source vector database
PMS150C应广单片机开发案例
Unified interface for reading and writing data files in xml/json/ini and ubjson formats
MySQL advanced - transaction and index
Intelligent hydropower meter energy consumption monitoring cloud platform
JDBC
wps插入图片后使图片完整显示
应广单片机开发案例
Redisson 高性能 Redis 分布式锁源码分析
Yingguang single chip microcomputer (MCU popular science)
[target tracking] | data set summary
[comment le réseau se connecte] chapitre 6: demande d'accès au serveur et réponse au client (terminé)
Tips for self defined packaging of Yingguang SCM 003 burner
finally详解
MySQL进阶-事务及索引
Design of the multi live architecture in different places of the king glory mall
PFC232-SOP8/14/16应广一级可带烧录程序编带
【曆史上的今天】7 月 2 日:BitTorrent 問世;商業系統 Linspire 被收購;索尼部署 PlayStation Now