Method 1:
Use the linux scheduled task shell script, use the shell command, and curl to specify the interface to connect to the database and store it in the database .
Method 2:
Specify a routing address, and then use some monitoring service platforms on the Internet, such as 360, etc. to regularly request the routes you have written for regular processing. business.
Method 3:
Write a shell script and regularly execute the URL routing written by curl yourself. This is relatively simple.
Linux scheduled tasks are divided into units at least, so you need to execute a custom script to process it in seconds.
The following is the script: the step variable value represents execution every second
#!/bin/bash step=10 for (( i = 0; i < 60; i=(i+step) )); do $(curl 'http://104.224.134.48/mobile/common/getGrabbingResult') sleep $step done exit 0
Recommended tutorial: PHP video tutorial
The above is the detailed content of Several ways to execute php scripts. For more information, please follow other related articles on the PHP Chinese website!