crontab 执行php 和tp 命令行

/usr/bin/php /www/wwwroot/www.baidu.com/public/index.php api/datacenter/hello1

/usr/bin/php /www/wwwroot/cserp.cbtbuy.com/think test

// 为think添加执行权限
chmod +x /home/wwwroot/default/www.xxx.com/think
crontab -e
// 每一小时执行一次
0 */1 * * * /usr/local/php/bin/php /home/wwwroot/default/www.xxx.com/think spider

第一步,配置command.php文件,目录在application/command.php

setName('test')->setDescription('Here is the remark '); } protected function execute(Input $input, Output $output) { $testModel = new TestModel(); $res = $testModel->index(); // $output->writeln("TestCommand:".$res); var_dump($res); } } 输入 php think test
原文地址:https://www.cnblogs.com/ianlab/p/14817026.html