假设Yii项目路径为 /home/apps/
1. 创建文件 /home/apps/protected/commands/crons.php
<?php$yii = '/home/apps/framework/yii.php';require_once($yii); $configFile = dirname(__FILE__).'/../config/console.php';Yii::createConsoleApplication($configFile)->run();
Yii通过控制台命令创建定时