Phpcurl downloads files to process files manually synchronized between servers

Source: Internet
Author: User
The phpcurl function can be used to download files. the following example uses phpcurl to download files to process files manually synchronized between servers. if you are interested, go to the page. one requirement is as follows: two servers, one test server [apa... the php curl function can be used to download files. the following example uses php curl to download files to process files manually synchronized between servers. if you are interested, go to the page.

There is a requirement as follows:

Two servers, one test server [apache] and one production server [nginx]. product editors use php upload to upload products and images in batches on the test server. after inspection, the uploaded products and images can be synchronized [packaged as zip files] to the production server, but the production server does not accept php upload to upload files, therefore, you cannot directly post to the official server on the test server.

Several methods are coming up for the moment:

1. use rsync to manually synchronize data, but you need to configure the data and execute shell commands in php, but I don't want.

2. you can use socket to transmit data, but you need to enable the port. I don't want to do this either, because if you forget to open the port on the firewall, you won't be able to transmit the data.

3. the test server sends signals to the production server so that the production server can use php curl to download and process files from the test server.

Through comparison, I still think the 3rd methods are more appropriate, and php is used to process them all the way, at least to reduce unnecessary maintenance troubles.

The following is the php curl download method code:

 


Tutorial link:

Reprint at will ~ However, please keep the tutorial address★

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.