Lnmp configuration multi PHP development environment

In the actual project, sometimes because of the reason of the old project, we have to configure multiple PHP environments on the same server. This article is a tutorial of configuring multiple PHP environmentsAssumption: the existing php7 environment needs to be configured with a PHP5 environment Compiling and installing php-5.6.27 Download ...

Posted on Sun, 08 Dec 2019 14:37:47 -0500 by apocryia

Two methods of database backup

Database backup is necessary. Generally, mysqldump is used for backup. I have written two backup methods for reference. The first is to use mysqldump and exec function to backup the database. The code is as follows: /** * Subject: php-mysql Realize database backup * User: luokakale * Date: 2018/11/9 * Time: 13:31 */ header('Content-Type: ...

Posted on Sun, 08 Dec 2019 13:46:35 -0500 by BPWheeler

The beginning of LSP client API

Create a new Laravel project and synchronize git $ valet restart $ cd ~/Sites $ laravel new Lsp-api-user Visit http://Lsp-api-user.test/, creation succeeded. $ cd ~/Sites/Lsp-api-user $ git checkout -b api-user $ git init $ git add . && git commit -m "Initial commit" $ git remote add origin git@git.coding.net:qbgugu/Lsp.git $ git pull ...

Posted on Sun, 08 Dec 2019 08:52:05 -0500 by sixdollarshirt

Redis usage record

Sorted Set Sorted Set, like Set, is a Set of String type with unique members. The difference is sorted SetA score of double type is associated for sorting.Members are unique, but the score can be repeated. If the score is repeated, the Dictionary ranking. The maximum number of members is 232 - 1 element (over 4 billion). Application scenario Ra ...

Posted on Sun, 08 Dec 2019 06:48:45 -0500 by pvraja

Message push based on Redis message queue

Message push based on Redis message queue Basic knowledge points We use the following commands to push our messages brpop blocking mode is removed after getting the value from the right side of the queue brpoplpush is deleted from the right side of queue A and placed in queue B from the left side logic analysis Write the target of the messag ...

Posted on Sat, 07 Dec 2019 21:07:21 -0500 by edg322

PHP uses fsockopen(), fputs() to request a URL, and does not require a return

The project needs the following scenarios: Under a certain condition, it is necessary to call the interface to send multiple requests to execute the script. However, since the execution time of the script under each request is about half an hour, it is OK to give up returning the execution result and only need to be able to send in seconds. The ...

Posted on Sat, 07 Dec 2019 17:09:32 -0500 by sangprabv

Practical analysis of getshell vulnerability in ThinkPHP 5.x remote code

Introduction to ThinkPHP ThinkPHP is a free, open-source, fast and simple object-oriented lightweight PHP development framework. Because of its ease of use and scalability, it has grown into an influential WEB application development framework in China Vulnerability analysis The cause of the vulnerability is that the framework does not detect t ...

Posted on Sat, 07 Dec 2019 10:09:08 -0500 by johnh

How to improve the quality of PHP code? Third: end to end / integration testing

In the final part of this series, it's time to set up an end-to-end / integrated test environment and make sure we're ready to check the quality of our work. In the first few parts of this series, we built a build tool, some static code analyzers, and started writing unit tests. In order to make our test stack more complete, there are some tes ...

Posted on Sat, 07 Dec 2019 07:28:51 -0500 by goaman

The use of fnmatch module in Python

The matching ability of fnmatch() function is between simple string method and powerful regular expression. If only a simple wildcard is needed in data processing, it is usually a reasonable scheme. The main function of this module is to match the file name, and the Unix shell style is used for the matching pattern. The source code is very simp ...

Posted on Sat, 07 Dec 2019 04:57:34 -0500 by lilman

Optimization scheme of PHP method with too many parameters

When we write PHP methods, we usually have several parameters, like the following code: Class Book { public function create($name, $cateId, $author) { $params = [ 'name' => $name, 'cateId' => $cateId, 'author' => $author ]; } } There is no problem. However, ...

Posted on Sat, 07 Dec 2019 01:26:31 -0500 by wood1e