Re: [PHP] Debugging Help Needed

2011-04-13 Thread Richard Quadling
On 13 April 2011 03:06, Paul M Foster pa...@quillandmouse.com wrote:
 On Tue, Apr 12, 2011 at 03:37:26PM -0700, Rich Shepard wrote:

 On Tue, 12 Apr 2011, Daniel Brown wrote:

    You missed the ending semicolon, that's all.

 Daniel,

   Oops! Too long since C and Python doesn't use semicolons.

 Wait, what?! Did they change C? When did this happen?! ;-}

 Paul

Oh they did a while ago. Didn't you read the memo?





-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Debugging Help Needed

2011-04-13 Thread Daniel Brown
On Tue, Apr 12, 2011 at 22:06, Paul M Foster pa...@quillandmouse.com wrote:

 Wait, what?! Did they change C? When did this happen?! ;-}

I believe he meant that it's been too long since he used C (which
uses semicolons) and that Python, which he used more recently, doesn't
use semicolons (which always trips me up whenever I have to patch
Python code).

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Debugging Help Needed

2011-04-13 Thread Rich Shepard

On Wed, 13 Apr 2011, Daniel Brown wrote:


   I believe he meant that it's been too long since he used C (which uses
semicolons) and that Python, which he used more recently, doesn't use
semicolons (which always trips me up whenever I have to patch Python
code).


  Thank you, Daniel.

  Inserting a call to debug_print_traceback() (with a terminating
semi-colon) at the top of the ErrorHandler404() function produces no visible
output (and nothing in the application directory or in ~/). Will someone
suggest either how I properly use debug_print_traceback() or otherwise learn
what's failing as I try to invoke the application and transferring control
to the error handler?

  There has to be something either in the index.php, or a function it's
calling, that cannot find the opening display. I need to learn what's
happening so I can get this application running here.

Rich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Debugging Help Needed

2011-04-12 Thread Rich Shepard

  I'm not a PHP coder, but I have an application written in PHP (CMS Made
Simple) that stopped working when I upgraded postgres to 9.x. I seem to have
most of the problems fixed (those with adodb_lite) but now need to track
down why I get a 404 Page Not Found error when I try to invoke the local
application. BTW, I'm running php-5.2.17 on Slackware-13.1.

  Running 'php index.php' from the application subdirectory to the document
root directory, I learn the code to search in the directory structure. It
turns out to be misc.functions.php, and the specific function in that file
is ErrorHandler404(). However, I have not been able to trace execution to
learn just where this function is being called.

  Looking at the PHP manual I see there's a function called
debug_print_backtrace(), but I have not found how to properly use it. When I
insert it at the top of ErrorHandler404(), php throws an error when I try to
run index.php:

function ErrorHandler404()
{
  debug_print_backtrace()
#if ($errno == E_USER_WARNING) {
@ob_end_clean();
header(HTTP/1.0 404 Not Found);
header(Status: 404 Not Found);
echo '!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title404 Not Found/title
/headbody

produces:

PHP Parse error:  syntax error, unexpected '@' in
/var/www/htdocs/cmsms/lib/misc.functions.php on line 223

  How can I determine where ErrorHandler404() is being called so I can fix
the problem and get the application running again?

Rich



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Debugging Help Needed

2011-04-12 Thread Daniel Brown
On Tue, Apr 12, 2011 at 18:29, Rich Shepard rshep...@appl-ecosys.com wrote:

  Looking at the PHP manual I see there's a function called
 debug_print_backtrace(), but I have not found how to properly use it. When I
 insert it at the top of ErrorHandler404(), php throws an error when I try to
 run index.php:

 function ErrorHandler404()
 {
  debug_print_backtrace()

You missed the ending semicolon, that's all.  So when this line comes up:

                @ob_end_clean();

PHP completely flips its lid and starts making threats against your life.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Debugging Help Needed

2011-04-12 Thread Rich Shepard

On Tue, 12 Apr 2011, Daniel Brown wrote:


   You missed the ending semicolon, that's all.


Daniel,

  Oops! Too long since C and Python doesn't use semicolons.

  Adding that, I remove the error but do not see the printed backtrace.
Please suggest how I can determine the source of the page not found error,
or how to capture output from debug_print_backtrace.

Thanks,

Rich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Debugging Help Needed

2011-04-12 Thread Paul M Foster
On Tue, Apr 12, 2011 at 03:37:26PM -0700, Rich Shepard wrote:

 On Tue, 12 Apr 2011, Daniel Brown wrote:
 
You missed the ending semicolon, that's all.
 
 Daniel,
 
   Oops! Too long since C and Python doesn't use semicolons.

Wait, what?! Did they change C? When did this happen?! ;-}

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php