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★