| How to debug PHP crashes (previously: "PHP: don't define functions inside switch ... |
 |
|
(How to debug PHP crashes (previously: "PHP: don't define functions inside switch statements"))
Hmm, looks like some versions of PHP, including the one running on outputthis.org, crash if you call a function defined inside a switch statement. Oops! --- BTW, if you find that your script is crashing PHP (i.e. your browser gives an error, the server drops the HTTP connection after receiving the headers, and you get an error in /var/log/apache/error.log like [notice] child pid 2706 exit signal Segmentation fault (11)), here's how you figure out what's going wrong - or at least get something to Google. * Step 1 - enable core dumping in Apache Edit /etc/apache/conf/httpd.conf (it might be at /etc/httpd/conf/httpd.conf) and set the CoreDumpDirectory option to a directory that Apache can write to. I created a new directory: mkdir /var/run/httpd-core chown apache.apache /var/run/httpd-core ... then put this line in httpd.conf: CoreDumpDirectory /var/run/httpd-core Now tell Apache to reload config: apachectl graceful * Step 2 - trigger the error Browse to the page or do whatever you ...
|
| 20:35:10 February 2, 2006, Thursday (PST) |
Source: Second p0st |
 |
|
Additional Info
First Fetched: 10:34:16 02/05/2006
Last Updated: 10:34:16 02/05/2006
|