当前位置:网站首页>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
边栏推荐
猜你喜欢
100天拿下11K,转岗测试的超全学习指南
又一款数据分析神器:Polars 真的很强大
On BIM data redundancy theory
Matlab matrix index problem
Scrapy教程 - (2)寫一個簡單爬蟲
The more you use the computer, the slower it will be? Recovery method of file accidental deletion
LeetCode 74、搜索二维矩阵
Vscode download speed up
Recommended usage scenarios and production tools for common 60 types of charts
LeetCode 116. 填充每个节点的下一个右侧节点指针
随机推荐
Solution: NPM err! code ELIFECYCLE npm ERR! errno 1
Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
缓存淘汰算法初步认识(LRU和LFU)
Commande dos pour la pénétration de l'Intranet
Parsing methods of JSON data in C - jar and jobobject: error reading jar from jsonreader Current JsonReader item
Latex formula
Vulnhub DC: 1 penetration notes
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
How to do after winning the new debt? Is it safe to open an account online
Awk example skills
LeetCode 1351、统计有序矩阵中的负数
go map
What about laptop Caton? Teach you to reinstall the system with one click to "revive" the computer
Bash script learning -- for loop traversal
Singleton mode
2021-06-29 C escape character cancellation and use
內網滲透之DOS命令
On IRP from the perspective of source code
Resolve the error - error identifier 'attr_ id‘ is not in camel case camelcase
BMP JPEG picture to vector image contourtrace