[英]CRON job with Symfony and mailer
我正在尝试使用 Symfony 命令设置向用户发送 email 的 CRON 作业。 电子邮件部分有效。 如果我在正确的目录中键入命令,我会收到我的 email。
所以我想出了这个 CRON 命令: cd /home/c1583306c/public_html && php bin/console app:send-email:send
但是当执行命令时,Symfony 似乎无法识别我的命令,这里是 output:
Symfony 5.2.3 (env: dev, debug: true)
Usage:
command [options] [arguments]
Options:
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-e, --env=ENV The Environment name. [default: "dev"]
--no-debug Switches off debug mode.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
about Displays information about the current project
help Displays help for a command
list Lists commands
app
app:send-email:send My test command
assets
assets:install Installs bundles web assets under a public directory
cache
cache:clear Clears the cache
难道我做错了什么?
注意:我必须指定文件夹。 否则,这将是 output:
状态:404 未找到 X-Powered-By:PHP/7.4.15 内容类型:text/html; 字符集=UTF-8
未指定输入文件。
我的 web 主机找到了解决方案,但没有告诉我为什么它不起作用。
解决方案:
/usr/local/bin/php /home/c1583306c/public_html/bin/console app:mail
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.