Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 74681 invoked from network); 19 Nov 2010 20:05:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Nov 2010 20:05:40 -0000 Received: (qmail 65893 invoked by uid 500); 19 Nov 2010 20:06:06 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 65859 invoked by uid 500); 19 Nov 2010 20:06:06 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 65851 invoked by uid 99); 19 Nov 2010 20:06:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Nov 2010 20:06:06 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.214.173] (HELO mail-iw0-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Nov 2010 20:06:01 +0000 Received: by iwn5 with SMTP id 5so259267iwn.18 for ; Fri, 19 Nov 2010 12:05:39 -0800 (PST) Received: by 10.231.11.9 with SMTP id r9mr2580426ibr.47.1290197139319; Fri, 19 Nov 2010 12:05:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.5.81 with HTTP; Fri, 19 Nov 2010 11:59:56 -0800 (PST) In-Reply-To: <4CE666D1.2090207@wpkg.org> References: <4CE666D1.2090207@wpkg.org> From: Scott Gifford Date: Fri, 19 Nov 2010 14:59:56 -0500 Message-ID: To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=00032557552a2ded4c04956d6eed Subject: Re: [users@httpd] debugging websites running on Apache? --00032557552a2ded4c04956d6eed Content-Type: text/plain; charset=ISO-8859-1 On Fri, Nov 19, 2010 at 7:00 AM, Tomasz Chmielewski wrote: > How do you debug websites running on Apache? > I have a few tricks I use. First, I try to write my applications so they can be run from the commandline. That means when they misbehave, I can run them directly under strace or a debugger to see what's going on. Others have suggested using the Xdebug profiler, but for what you are looking at, the debugger might be more helpful. You an just step through the code one line at a time. You can try running a Web server on an alternate port that only you use, so that there will be no noise from other clients. Sometimes I will have my applications write their PID to the error_log then sleep for 30 seconds or so. I can get their PID then and start an strace on just that process. You can limit this so they only do it when a request has a particular parameter, comes from a particular IP address, etc. Hope some of these techniques are helpful to you, ----Scott. --00032557552a2ded4c04956d6eed Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, Nov 19, 2010 at 7:00 AM, Tomasz Chmielewski <<= a href=3D"mailto:mangoo@wpkg.org">mangoo@wpkg.org> wrote:
=
How do you debug websites running on Apache?

I have a few tricks I use.

First, I try to w= rite my applications so they can be run from the commandline. =A0That means= when they misbehave, I can run them directly under strace or a debugger to= see what's going on.

Others have suggested using the Xdebug profiler, but fo= r what you are looking at, the debugger might be more helpful. =A0You an ju= st step through the code one line at a time.

You c= an try running a Web server on an alternate port that only you use, so that= there will be no noise from other clients.

Sometimes I will have my applications write their PID t= o the error_log then sleep for 30 seconds or so. =A0I can get their PID the= n and start an strace on just that process. =A0You can limit this so they o= nly do it when a request has a particular parameter, comes from a particula= r IP address, etc.

Hope some of these techniques are helpful to you,
=

----Scott.

--00032557552a2ded4c04956d6eed--