Although I have always used git for version management, I have also used git project deployment before, but I have not adhered to this habit. Recently I decided to learn more. The following article mainly introduces you to the method of git deployment in PHP. The tutorial is very detailed through sample code. Friends in need can refer to it.
Background
#On a small site, it is very convenient to directly use git to deploy php code, your remote site and local version Libraries have a version control, making it easy to track down issues or roll back.
Because I work in a small company, the original system still uses traditional ftp upload and deployment. It is too troublesome to deploy and it is not easy to control the online code. I searched for a git deployment tutorial on the Internet, and encountered a lot of pitfalls along the way. Now I post the whole process, hoping it can help everyone. I won’t say much below, let’s take a look at the detailed introduction.
Account related
1 2 3 4 5 6 |
|
Be sure to pay attention to permission issues here. Otherwise, the key login will not take effect. The corresponding permissions of each folder are as follows
1 2 3 4 |
|
##File permission settings
Warehouse code
1 2 |
|
git configuration
1 |
|
Set sudo password-free
1 2 3 4 5 6 7 |
|
Hook settings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
hook.php content
1 2 3 4 5 6 7 8 9 10 |
|
Increase hook executable permissions
1 |
|
Local code
1 2 |
|
Special attention
Summary
##Explanation and analysis of binary search algorithm implemented in PHPExplanation of the half search algorithm implemented in PHPExample of string matching algorithm implemented in PHPThe above is the detailed content of Detailed tutorial on how to implement git deployment in PHP. For more information, please follow other related articles on the PHP Chinese website!