我创建了两个 php 文件,分别执行两个单独的任务。
我曾尝试使用批处理文件运行相同的脚本,但这是第一部分失败的地方。Xlsx 文件永远不会被创建,因此发送电子邮件时没有附加文档。
我尝试通过批处理脚本单独运行每个脚本。
第二部分(发送邮件)按预期工作。
通过批处理脚本创建文件似乎是问题所在。
REM This adds the folder containing php.exe to the path
PATH=%PATH%;C:\php
REM Change Directory to the folder containing your script
CD C:\Apache24\htdocs\phpspreadsheet\reporting
REM Execute
php report_v1.1.php
REM Change Directory to the folder containing your script
CD C:\Apache24\htdocs\Automation
REM Execute
php report.php
我想自动化这两个脚本以按顺序运行,以便我可以自动将报告发送给相关收件人。我没有从第一个脚本中得到任何错误消息,在通过命令行执行它进行测试时,终端屏幕上只有很多随机字符。
Qyouu