开发者

How do I troubleshoot a breaking script?

开发者 https://www.devze.com 2023-03-07 06:30 出处:网络
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 un

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 i开发者_如何学编程t 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消