The correct way to execute PHP programs with crontab under Linux

  
 

Under Linux, you can use Crontab+PHP
method: 1. Use crontab –e to edit the timed task content: xx:xx:xx Execute a test.php file 2, php file must be in The first line of the file, plus the interpreter path (as perl does) #!/usr/local/bin/php PHP implementation requires Apache support, shell script execution requires Linux support, and Linux supports a certain timed run The function of a program ---------------------------------------------- ----------------- Use PHP as a shell scripting language (quote)

※ I am lazy, the previous method is directly in /etc/crontab Directly bring the php path, such as */5 * * * * root php test.php, can also be executed correctly; interested friends can write a hello world program test, output all of them to a file to test, and finally wish Everyone is happy to work.

Copyright © Windows knowledge All Rights Reserved