Home > Article > Backend Development > crontab - Cron execution of PHP files using CI framework
To do the project, a certain PHP file needs to be executed every minute to process the data, and the LNMP used cannot be directly accessed through 127.0.0.1
I have never been exposed to Cron before. I searched online and now there are several solutions planned.
Simulate the client to send a request to the domain/path every minute.
Implement the reading, parsing, encapsulation and storage of data into the database without the help of a framework.
I wonder if you have any good ideas? The framework uses CI
To do the project, a certain PHP file needs to be executed every minute to process the data, and the LNMP used cannot be directly accessed through 127.0.0.1
I have never been exposed to Cron before. I searched online and now there are several solutions planned.
Simulate the client to send a request to the domain/path every minute.
Implement the data reading, parsing, encapsulation and storage without using the framework.
I wonder if you have any good ideas? The framework uses CI
Use linux crontab
ah
<code>##调用PHP文件写法 */10 * * * * /usr/local/webserver/php/bin/php /www/project/test.com/price.php ##sh写法 */10 * * * * sh /www/project/test.com/price.sh ##laravel框架写法 * * * * * /usr/local/php/bin/php /home/project/service.com/artisan schedule:run ##ThinkPHP框架写法 */1 * * * * /usr/local/webserver/php/bin/php /www/home/project/dc/cli.php CancelOrder/cancel </code>