ncurses and error output

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Volker Kamp

    ncurses and error output

    Hi,
    I'm using the CLI SAPI of PHP to create ncurses programs. All works fine
    instead of debugging, since most PHP debuggers are not compatible to CLI.
    The worst is, that after calling ncurses_init() any error or warning printed
    out by PHP goes to nowhere, since ncurses seems to block any output to
    STDERR.
    I tried redirecting STDERR with "script.php 2> err.txt", but this does'nt
    work.
    Any ideas?
    Thanks a lot,
    Volker



  • Colin McKinnon

    #2
    Re: ncurses and error output

    Volker Kamp wrote:
    [color=blue]
    > Hi,
    > I'm using the CLI SAPI of PHP to create ncurses programs. All works fine
    > instead of debugging, since most PHP debuggers are not compatible to CLI.
    > The worst is, that after calling ncurses_init() any error or warning
    > printed out by PHP goes to nowhere, since ncurses seems to block any
    > output to STDERR.
    > I tried redirecting STDERR with "script.php 2> err.txt", but this does'nt
    > work.[/color]

    Write your own error handler - it can't cope with parse errors, but you can
    use 'php -l' for that. See


    HTH

    C.

    Comment

    • Volker Kamp

      #3
      Re: ncurses and error output

      [color=blue][color=green]
      > > I'm using the CLI SAPI of PHP to create ncurses programs. All works fine
      > > instead of debugging, since most PHP debuggers are not compatible to[/color][/color]
      CLI.[color=blue][color=green]
      > > The worst is, that after calling ncurses_init() any error or warning
      > > printed out by PHP goes to nowhere, since ncurses seems to block any
      > > output to STDERR.
      > > I tried redirecting STDERR with "script.php 2> err.txt", but this[/color][/color]
      does'nt[color=blue][color=green]
      > > work.[/color]
      >
      > Write your own error handler - it can't cope with parse errors, but you[/color]
      can[color=blue]
      > use 'php -l' for that. See
      > http://uk2.php.net/manual/en/functio...or-handler.php
      >[/color]
      Thanks, good idea, but I also like to see fatal errors, like calls to
      undefined
      functions. AFAIK php always handles fatal errors internaly without the use
      of user error handlers. And "php -l" can't find undefined funcs. Hmm...
      Any other idea?
      Volker




      Comment

      Working...