laravel应用在运行`Artisan cache:clear`或`config:clear`命令时显示白屏页面。

huangapple go评论54阅读模式
英文:

laravel app shows white blank page on Artisan cache:clear or config:clear command

问题

我的Laravel应用程序运行得相当顺利,但我注意到邮件配置没有使用ENV中的值,所以我运行了artisan config:clear。然后,当我重新加载网站时,显示一个空白白色页面。

到目前为止,我已经尝试了以下方法,但仍然没有解决:

  • 检查ENV值中是否有空格(没有找到)
  • 运行artisan config:cacheconfig:clearview:clearroute:clear,甚至clear
  • 手动删除bootstrap缓存文件夹中的缓存文件

有人在此之前遇到过这个问题吗?

英文:

My laravel app is working quite well but I noticed the mail config is not using the value from ENV so I ran artisan config:clear. Then, when I reload, the website shows a blank white page.

This are what I have tried so far but still not working:

  • Check for whitespace in ENV value (found none)
  • Run artisan config:cache, config:clear, view:clear, route:clear and even clear
  • Delete cache files in bootstrap cache folder manually

Anyone experienced this before?

答案1

得分: 0

感谢您的帮助,我已经解决了这个问题。

  • 我的网站托管在共享主机上,我是通过路由运行artisan命令。
  • 后来,我能够使用SSH访问来运行artisan命令,结果返回了一个错误,阻止了命令的运行。
  • 错误是,每次我保存并写入env文件时,我的APPNAME之间都有一个换行符。
  • 由于当我访问清除路由时artisan命令没有运行,因此缓存配置未清除,因此在尝试发送邮件时返回了已经缓存的数据。
英文:

Thanks for the help, I have been able to solve it.

  • My website was hosted on a shared hosting and I was running artisan command through route.
  • Later I was able to use ssh access to run artisan command and turns out that it returns an error which prevent the command from running.
  • The error was that each time I save and write value to env file, there was a break line between my APPNAME.
  • Since the artisan command didn't run when I hit the clear route, the cache config does not clear thereby returns the already cached data when trying to send mail.

huangapple
  • 本文由 发表于 2023年4月4日 14:09:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75926003.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定