当前位置:网站首页>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
composerThe 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
边栏推荐
- go defer
- LeetCode 709、转换成小写字母
- Go zero framework database avoidance Guide
- Summary and effect analysis of methods for calculating binocular parallax
- 2021-06-29 C escape character cancellation and use
- How to do after winning the new debt? Is it safe to open an account online
- The construction and use of Fortress machine and springboard machine jumpserver are detailed in pictures and texts
- MySQL进阶之数据的增删改查(DML)
- 又一款数据分析神器:Polars 真的很强大
- Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
猜你喜欢

Summary and effect analysis of methods for calculating binocular parallax

Unity solves Z-fighting

LeetCode 116. Populate the next right node pointer for each node

Elastic box model

笔记本电脑卡顿怎么办?教你一键重装系统让电脑“复活”

Linux中,MySQL的常用命令

The ODB model calculates the data and outputs it to excel

What about laptop Caton? Teach you to reinstall the system with one click to "revive" the computer

Monte Carlo py solves the area problem! (save pupils Series)

Unity Odin ProgressBar add value column
随机推荐
C migration project record: modify namespace and folder name
Learn to C language fourth day
Unity Odin ProgressBar add value column
[matlab 2016 use mex command to find editor visual studio 2019]
LeetCode 542、01 矩阵
Linux中,MySQL的常用命令
黑客的入侵方式你知道几种?
Singleton mode
Leetcode 1346. Check whether integers and their multiples exist
2022dasctf APR x fat epidemic prevention challenge crypto easy_ real
go array
Psychological formula for converting RGB to gray value
Introduction to standardization, regularization and normalization
Learn to C language fourth day
Install MySQL 5.0 under Linux 64bit 6 - the root password cannot be modified
Fastdfs思维导图
MySQL stored procedures and functions
Rt-1052 learning notes - GPIO architecture analysis
Use of node template engine
Create vs project with MATLAB