a debug technique enquiry

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

    a debug technique enquiry

    Dear all,

    when i add

    include('abc.ph p');

    in the last line of 'def.php',

    the codes in abc.php were once executed. now after series of changes
    (including setting php.ini), i don't know which one makes a bug.

    here is the starting lines of abc.php:


    <?php
    // indicate test version or public version.
    // 0: prompt 1: test 2: Web
    $type = 2;

    print "<h2>Welcom e to this page</h2>\n";

    exit;

    ....[color=blue]
    >[/color]

    the print is to see if it works or not but it even doesn't print out.
    permission of abc.php hasn't been changed and every time i run def.php, the
    timestamp of abc.php shows an update accordingly.

    What can i do in abc.php to debug?

    thanks a lot.


  • Dana Cartwright

    #2
    Re: a debug technique enquiry

    "vito" <vitogen2003@ya hoo.com.tw> wrote in message
    news:e5s213$2eg 2$1@justice.its c.cuhk.edu.hk.. .[color=blue]
    > Dear all,
    >
    > when i add
    >
    > include('abc.ph p');
    >
    > in the last line of 'def.php',
    >
    > the codes in abc.php were once executed. now after series of changes
    > (including setting php.ini), i don't know which one makes a bug.
    >
    > here is the starting lines of abc.php:
    >
    >
    > <?php
    > // indicate test version or public version.
    > // 0: prompt 1: test 2: Web
    > $type = 2;
    >
    > print "<h2>Welcom e to this page</h2>\n";
    >
    > exit;
    >
    > ...[color=green]
    >>[/color]
    >
    > the print is to see if it works or not but it even doesn't print out.
    > permission of abc.php hasn't been changed and every time i run def.php,
    > the timestamp of abc.php shows an update accordingly.
    >
    > What can i do in abc.php to debug?
    >
    > thanks a lot.[/color]

    Start by fixing the syntax at the end of the file. It's "?>" not simply
    ">".


    Comment

    • vito

      #3
      Re: a debug technique enquiry

      > Start by fixing the syntax at the end of the file. It's "?>" not simply[color=blue]
      > ">".[/color]

      a typo only. the original files each have that one.


      Comment

      • Rik

        #4
        Re: a debug technique enquiry

        vito wrote:[color=blue]
        > the print is to see if it works or not but it even doesn't print out.
        > permission of abc.php hasn't been changed and every time i run
        > def.php, the timestamp of abc.php shows an update accordingly.
        >
        > What can i do in abc.php to debug?[/color]

        First of all: You have display errors on, and error_reporting set to E_ALL?

        Second, it's probably def.php that needs to be debugged. Try a simple
        include file:

        <?php print("untill here it works"); ?>
        And move it up in your def.php untill it works, the error is somewhere
        below.

        Cutting out large pieces of code in a copied version untill you can
        reproduce the problem with a minimal amount of code is always very
        clarifying.

        Grtz,
        --
        Rik Wasmus


        Comment

        • Rik

          #5
          Re: a debug technique enquiry

          vito wrote:[color=blue][color=green]
          >> Start by fixing the syntax at the end of the file. It's "?>" not
          >> simply ">".[/color]
          >
          > a typo only. the original files each have that one.[/color]

          The '?>' is often reduced to '>' by newsreaders, highly probable it was in
          the code you sent :-)

          Grtz,
          --
          Rik Wasmus


          Comment

          Working...