404 页面未找到 - CodeIgniter 相关
我在一个项目中使用 Codeigniter 框架 - 我有一个工具可以读取数组并使用 SwiftMailer 电子邮件框架发送超过 10,000 封电子邮件。
我曾经提交的一份表格应该发送每封单独的电子邮件,但是它并没有发送所有电子邮件,因为在一段时间后我收到以下错误:
404 页面未找到您请求的页面未找到。 - 500.shtml
页面本身实际上并没有重定向到其他任何地方,所以无法理解为什么它会这样说 - 有人有任何想法吗?
谢谢
I am using the Codeigniter framework in a project - I have a tool which reads an array and sends out over 10,000 emails using the SwiftMailer Email framework.
One form which I have once submitted is supposed to send out each individual email, however it doesnt sent out all of them as after a period of time I get the following error:
404 Page Not FoundThe page you requested was not found. - 500.shtml
The page itself doesnt actually redirect anywhere else so cannot understand why it would be saying this - anyone have any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您实际上最终遇到了 500 错误,但是当 CI 尝试显示 500 错误的自定义错误页面 (500.shtml) 时,它找不到它,因此会抛出 404。检查日志以查找 500 错误的原因。
It looks like you're actually ending up with a 500 error, but when CI tries to display the custom error page for a 500 error (500.shtml), it can't find it, and so throws a 404 instead. Check your logs for the cause of the 500 error.
这将是一个自定义错误页面,可能在网络服务器本身上设置。如果它是 Apache 服务器,请检查 httpd 配置并删除任何 ErrorDocument 您不需要的指令,这样您就可以看到实际的错误。
正如汤姆所说,如果这种情况发生在明显的延迟之后,您可能会遇到超时。可以使用
set_time_limit( 从 PHP 端增加超时长度)
或 php.ini 设置max_execution_time
。然而,一般来说,如果您有一个长时间运行的任务,那么在后台进程中运行它比尝试将其硬塞到 HTTP 请求中要好得多。It'll be a custom error page, probably set up on the web server itself. If it's an Apache server, check the httpd config and remove any ErrorDocument directives you don't want so you can see the actual error.
As Tom said, if this is happening after a significant delay, you're likely getting a timeout. The length of timeouts can be increased from the PHP end using
set_time_limit()
or the php.ini settingmax_execution_time
. However in general if you have a long-running task it is much better to run it in a background process than try to shoehorn it into an HTTP request.