Solved

PHP on Windows - how to log when a script is timing out

Posted on 2011-09-24
3
144 Views
Last Modified: 2012-05-12
I have a php application that I did not write that is running on my server (IIS on Windows 2003 Server).  I suspect that I am having a php timeout issue, but am not sure.  Is there a way to know for certain that a timeout is occurring?  Can this be written to the log file?  If so, how?

I just need some clear confirmation that what I am seeing is a php timeout.
0
Comment
Question by:sah18
3 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
I suggest you click on "Request Attention" and get the IIS web server zones added.  The timeout message may or may not tell you what timed out.  The IIS log should.
0
 
LVL 13

Expert Comment

by:themrrobert
Comment Utility
If you find the php installation directory, look in the directory for error.log  update this log file.

This log file is very detailed on showing php errors and should help get you on track
0
 
LVL 7

Accepted Solution

by:
kshna earned 500 total points
Comment Utility
check for register_shutdown_function

http://php.net/manual/en/function.register-shutdown-function.php

write a shutdown function to log all the errors and warnings....  like this. .. .
register_shutdown_function('logErr');
function logErr(){
$path_to_logfile = "/tmp";
error_log("<br>".print_r(error_get_last(),true),3,$path_to_logfile);
}

Open in new window


hope it helps
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now