Then chmod +x test .php gives test.php executable permissions. 3. Command crontab -e */1 * * * * /var/www/test.php Execute test.php every minute 4、/etc/init.d/cron restart Second way: 1. vi /etc/crontab */1 * * * * root /var/www/test.php 2. You can also remove the first line of the test.php header #!/usr/bin/php -q Then the crontab task is written as: */1 * * * * root /usr/bin/php /var/www/test.php Note: The path for php execution is relative/root. Finally, write the absolute path |