如何对损坏的脚本进行故障排除?

发布于 2024-11-08 11:56:16 字数 556 浏览 0 评论 0原文

我在我的表单的一部分上使用 plupload 多文件上传器。我可以将所有照片上传到服务器。据我了解,PLupload 基本上上传文件,然后在表单上放置隐藏字段。当我提交表单以创建记录时,脚本需要一段时间才能运行,最后输出。奇怪的是,它达到了大约 47 条记录的某种限制,然后停止了 HTML 输出,不显示其余图片是否发生任何情况,也不显示我的页脚。

我需要一些帮助来解决我的脚本失败的原因。我在循环中的各个点回显了 memory_get_peak_usage ,并且内存似乎始终保持稳定。我还使用 imagedestroy() 清除了我创建的一些图像资源以释放所有内存。我还在循环中添加了 set_time_limit(10); 以防超时。

我还打开了error_reporting。

ini_set('display_errors',1); 
error_reporting(E_ALL);

我没有收到任何错误,只是输出低于预期。我检查了 Apache 日志,里面没有任何内容。 有人对进一步解决此问题的技术有意见吗?

I am using plupload multi file uploader on part of my form. I am able to upload all my photos to the server. PLupload basically uploads the files, then places hidden fields on the form, from what I understand. When I submit the form so as to create records the script takes a while to run, and finally outputs. The strange thing is that it reaches some sort of limit at around 47 records, and then stops with the HTML output, not showing if anything happens with the rest of the pictures, and not displaying my footer.

I need some help troubleshooting why my script is failing. I have echoed out memory_get_peak_usage at various points in my loop and memory seems to be stable throughout. I have also used imagedestroy() to clear out some of the image resources that I have created to free up any memory. I also added set_time_limit(10); in my loop in the case that it was timing out.

I have also turned on error_reporting.

ini_set('display_errors',1); 
error_reporting(E_ALL);

I don't get any errors, just less than expected output. I have checked the Apache logs, and there is nothing in there.
Does anyone have input on techniques for troubleshooting this further?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深居我梦 2024-11-15 11:56:16

Apache 错误应该位于 http-errors.log 中
在 Linux 中,该文件位于 var/log/http-error.log
在 Windows 中我不知道,也不关心。

Apache errors should be in http-errors.log
In linux this file is on var/log/http-error.log
In windows I don't know, do not care either.

又爬满兰若 2024-11-15 11:56:16

我不知道这是否适用于这种特定情况,但我所做的是,我通常创建一个包装文件“debug.php”,其中包含您的两行,然后包含不起作用的脚本,即

ini_set('display_errors', true);
error_reporting(E_ALL);

require_once('my_script.php');

这通常有助于检测由于不同原因而未显示的错误。

I don't know if this is applicable on this specific case but what I do is that I usually create a wrapper file "debug.php" which contains your two lines and then includes the script which is not working, i.e.

ini_set('display_errors', true);
error_reporting(E_ALL);

require_once('my_script.php');

This usually helps detecting errors otherwise not shown for different reasons.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文