crontab - Cron execution of PHP files using CI framework
Aug 04, 2016 am 09:20 AM
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
Reply content:
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>

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
