Home  >  Article  >  Backend Development  >  How to clone an entire PHP website

How to clone an entire PHP website

王林
王林Original
2019-09-09 15:19:575790browse

How to clone an entire PHP website

This article introduces curlMulti, a cloning tool. With this tool, non-technical people can quickly clone the entire site.

Tool linkhttps://github.com/ares333/php-curl

Tool features

1. Capture various resources of the website html\Css\Js\RAR compressed files, etc.

2. Parallel crawling, the crawling speed is amazing

Operation process:

This article uses mac for explanation.

1. Download tool

How to clone an entire PHP website

##2. Preparation

How to clone an entire PHP website

How to clone an entire PHP website

Under normal circumstances, changing the URL will be ok. If the site to be cloned is very large, you need to add code in the first line:

ini_set('memory_limit', '2048M');

3. Execute cloning

1. Open the terminal


How to clone an entire PHP website

How to clone an entire PHP website

Perform the following operations in the terminal:


Right-click the site_clone1.php file, "Show Introduction" , select the text as shown in the figure, copy

How to clone an entire PHP website

Input in the terminal: "cd ", then Ctrl v to paste the content you just copied, and press Enter (enter the characters without double quotes)

My terminal looks like this, it can be used as a reference:

How to clone an entire PHP website

Enter in the terminal:

php site_clone1.php

At this point, cloning has started . Remember, do not close the terminal window. (If you want to continue cloning after closing the window, please contact me)

If the website you want to clone is relatively small, such as a novel site, it can be done in half an hour (clone 100 pages per second without any pressure)

4. Website storage directory

How to clone an entire PHP website##Double-click index. html can open the cloned website.

Attachment: If you want faster cloning, do the following:

How to clone an entire PHP website

如果要测试500并发,那需要在终端多执行一行命令:

ulimit -n 1000

以上内容仅供参考!

推荐视频教程:PHP视频教程

The above is the detailed content of How to clone an entire PHP website. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn