当前位置:网站首页>Common problems in deploying projects with laravel and composer for PHP
Common problems in deploying projects with laravel and composer for PHP
2022-04-23 20:45:00 【Jan York】
We are deploying PHP Project time , In fact, most of them PHP The project will create environment detection and one click **Install
** page .
however , Many projects also use Composer
Deploy .
What is? Composer
As for what is Composer
, Let me just say it briefly .
Composer
yes PHP A dependency management tool for . We can declare the dependent external tool library in the project ,Composer
Will help you install these dependent library files , With it , We can easily use a command to reference other people's excellent code into our project .
amount to Node
Inside npm
.
Laravel frame
Laravel
It's open source PHP frame , Powerful and easy to understand . It follows the model - View - Controller design mode (MVC).Laravel
Reusing existing components of different frameworks , This helps create Web Applications . Designed like this Web Applications are more structured and practical .
I won't talk about the specific features , One of the more remarkable is , The dependency manager is completely based on composer
.
Report errors :php artisan key:generate
This mistake , There are generally three questions , Solve it accordingly .
Report errors 1:PHP Script takes up too much memory ,memory_limit Default 128m Not enough use . PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted . Composer Command fails : Composer Internal increase memory_limit To 1.5G.
Report errors 2:PHP Version of the problem .
This is based on symptomatic analysis .
Pay attention to is , Sometimes it's not your project PHP The version doesn't work , It's you
composer
The version of does not correspond to .
Report errors 3: You need to update composer.
composer update
Laravel appear No application encryption key has been specified.
First , We need to see if there is .env
file , perhaps .env
After the file is added .example
suffix .
1、.env.example Change the name and use the command copy It is amended as follows .env.
At this time, it may also indicate that Key. We use the command to generate .
2、 Use command php artisan key:generate
Get password , Auto save to .env.
The command can be run directly at the terminal .
Composer Get dependency timeout
First, determine whether the dependency package exists .
secondly , It may be a foreign source , Download timeout is normal , We use the command to change the source to the domestic source .
composer config -g repo.packagist composer https://packagist.phpcomposer.com
Composer
The pit brought by the upgrade : Undefined index: name
I also encountered this problem during deployment , We can directly try to roll back the version or reduce the version , Deploy it and then upgrade it back .
Undefined index: name
If this error exists , So we can do this :
# composer Downgrade
composer self-update --1
# Re install , that will do !!!
composer install
Or you don't need to install it again , We can also run the first sentence directly .
composer self-update --1
As for other methods , Don't suggest , I won't write any more .
版权声明
本文为[Jan York]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204232039376011.html
边栏推荐
- 三十.什么是vm和vc?
- LeetCode 709、转换成小写字母
- [matlab 2016 use mex command to find editor visual studio 2019]
- 又一款数据分析神器:Polars 真的很强大
- LeetCode 542、01 矩阵
- Recognition of high-speed road signs by Matlab using alexnet
- How do BIM swindlers cheat? (turn)
- Scrapy教程 - (2)寫一個簡單爬蟲
- Modeling based on catiav6
- Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
猜你喜欢
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
Resolve the error - error identifier 'attr_ id‘ is not in camel case camelcase
How to configure SSH public key in code cloud
LeetCode 994、腐烂的橘子
Rt-1052 learning notes - GPIO architecture analysis
Shanghai responded that "flour official website is an illegal website": neglect of operation and maintenance has been "hacked", and the police have filed a case
LeetCode 116. Populate the next right node pointer for each node
3-5通过XSS获取cookie以及XSS后台管理系统的使用
Matlab: psychtoolbox installation
随机推荐
The ODB model calculates the data and outputs it to excel
[PTA] get rid of singles
黑客的入侵方式你知道几种?
How many hacking methods do you know?
[PTA] l1-002 printing hourglass
上海回应“面粉官网是非法网站”:疏于运维被“黑”,警方已立案
Communication between RING3 and ring0
Easy to use nprogress progress bar
LeetCode 1346、检查整数及其两倍数是否存在
LeetCode 116. 填充每个节点的下一个右侧节点指针
Linux中,MySQL的常用命令
go interface
Leetcode 74. Search two-dimensional matrix
"Meta function" of tidb 6.0: what is placement rules in SQL?
Resolve the eslint warning -- ignore the warning that there is no space between the method name and ()
Unity asset import settings
Async function ------ ES6
Unity animation creates sequence frame code and generates animationclip
On IRP from the perspective of source code
Go language development Daily Fresh Project Day 3 Case - Press Release System II