简体   繁体   English

如何解决脚本损坏的问题?

[英]How do I troubleshoot a breaking script?

I am using plupload multi file uploader on part of my form. 我在表单的一部分上使用了plupload多文件上传器。 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. 根据我的理解,PLupload基本上是上传文件,然后将隐藏字段放在表单上。 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. 奇怪的是,它达到了大约47条记录的某种限制,然后停止了HTML输出,没有显示其余图片是否发生任何事情,并且没有显示我的页脚。

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. 我在循环的各个点回显了memory_get_peak_usage ,并且整个内存似乎都很稳定。 I have also used imagedestroy() to clear out some of the image resources that I have created to free up any memory. 我还使用imagedestroy()清除了一些我创建的图像资源,以释放所有内存。 I also added set_time_limit(10); 我还添加了set_time_limit(10); in my loop in the case that it was timing out. 在我的循环中,以防超时。

I have also turned on error_reporting. 我还打开了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. 我已经检查了Apache日志,那里什么也没有。 Does anyone have input on techniques for troubleshooting this further? 有人对进一步解决此问题的方法有意见吗?

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

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, ie 我不知道这是否适用于此特定情况,但我要做的是通常创建一个包装文件“ debug.php”,其中包含您的两行,然后包含不起作用的脚本,即

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. 这通常有助于检测由于其他原因而未显示的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM