宝塔Window面板下如何执行PHP计划任务
1.简历一个.bat文件,内容为:
"D:\phpStudy\PHPTutorial\php\php-7.0.12-nts\php.exe" -f "D:\phpStudy\PHPTutorial\WWW\andy\public\index.php" "index/index/index"
执行。
如果已经配置过(PHP)环境变量则使用下面的 :
php -f "D:\phpStudy\PHPTutorial\WWW\andy\public\index.php" "index/index/index"

如果你的是多级控制器:
"D:\phpStudy\PHPTutorial\WWW\andy\public\index.php" "index/arm.index/index"

2.打开打开 任务计划程序
开始-控制面板-管理工具-任务计划程序
添加任务 配置如下



如果你配置后,仍然不能运行:请使用cmd命令执行看看报错:
执行命令:
"D:\phpStudy\PHPTutorial\php\php-7.0.12-nts\php.exe" -f "D:\phpStudy\PHPTutorial\WWW\andy\public\index.php" "index/index/index"
配置过(PHP)环境变量
执行命令:
php -f "D:\phpStudy\PHPTutorial\WWW\andy\public\index.php" "index/index/index"

此为正常执行的
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。