yii如何执行php脚本,示例,脚本,环境,相关内容,中文网
yii如何执行php脚本
易采站长站,站长之家为您整理了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启动定时任务设置窗口
更多编程相关内容,请关注php中文网编程入门栏目!以上就是关于对yii如何执行php脚本的详细介绍。欢迎大家对yii如何执行php脚本内容提出宝贵意见