您好,欢迎访问一九零五行业门户网

yii如何执行php脚本

1、编码执行
示例:
<?php/** * created by phpstorm. * user: administrator * date: 2018/4/12 0012 * time: 下午 5:43 *//** * 示例代码 * class testcommand */class testcommand extends cconsolecommand{ /** * * 测试(项目根目录下执行) * * 脚本执行示例: * windows环境: * >yiic.bat test index * linux环境: * >yiic test index */ public function actionindex() { echo "ok"; exit(); }}
(相关教程推荐:yii框架)
2、cmd执行
yiic.bat test index

yiic test index
3、windows定时执行
生成脚本.bat文件
d:\phpstudy\www\wwwerp\protected\yiic.bat ebaycrontab run
添加定时任务:
taskschd.msc启动定时任务设置窗口
更多编程相关内容,请关注编程入门栏目!
以上就是yii如何执行php脚本的详细内容。
其它类似信息

推荐信息