php.ini - errors not being thrown

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

    php.ini - errors not being thrown

    Hi guys,

    I'm somewhat new to PHP, so please excuse what I hope is an easy
    question.

    I've experienced some issues lately where the code on my development
    environment throws no errors, but when I upload to a shared hosting
    server errors are thrown.

    The latest was when I had output before calling header(); which should
    normally throw an error. As mentioned above, this threw no errors on
    my local machine but did only when I uploaded to another server.

    My setup is:
    - PHP 5.2.5
    - Windows XP
    - Apache

    The following is from my php.ini:
    - display_errors: On
    - error_reporting :8191

    I also have error_reporting (E_ALL | E_STRICT); in my project.

    Can anyone please let me know what you would run in production in
    terms of exception throwing?

    Thanks,

    Michael
  • Jerry Stuckle

    #2
    Re: php.ini - errors not being thrown

    Michael Sharman wrote:
    Hi guys,
    >
    I'm somewhat new to PHP, so please excuse what I hope is an easy
    question.
    >
    I've experienced some issues lately where the code on my development
    environment throws no errors, but when I upload to a shared hosting
    server errors are thrown.
    >
    The latest was when I had output before calling header(); which should
    normally throw an error. As mentioned above, this threw no errors on
    my local machine but did only when I uploaded to another server.
    >
    My setup is:
    - PHP 5.2.5
    - Windows XP
    - Apache
    >
    The following is from my php.ini:
    - display_errors: On
    - error_reporting :8191
    >
    I also have error_reporting (E_ALL | E_STRICT); in my project.
    >
    Can anyone please let me know what you would run in production in
    terms of exception throwing?
    >
    Thanks,
    >
    Michael
    >
    To start with, is this the syntax you have in your php.ini file? It
    should be:

    display_errors= on
    error_reporting =E_ALL
    (or E_ALL | E_STRICT)

    Next, are you sure this is the php.ini file you're using? What does
    phpinfo() show for these settings and the php.ini file being used?

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Michael Sharman

      #3
      Re: php.ini - errors not being thrown

      On May 18, 12:12 am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
      Michael Sharman wrote:
      Hi guys,
      >
      I'm somewhat new to PHP, so please excuse what I hope is an easy
      question.
      >
      I've experienced some issues lately where the code on my development
      environment throws no errors, but when I upload to a shared hosting
      server errors are thrown.
      >
      The latest was when I had output before calling header(); which should
      normally throw an error. As mentioned above, this threw no errors on
      my local machine but did only when I uploaded to another server.
      >
      My setup is:
      - PHP 5.2.5
      - Windows XP
      - Apache
      >
      The following is from my php.ini:
      - display_errors: On
      - error_reporting :8191
      >
      I also have error_reporting (E_ALL | E_STRICT); in my project.
      >
      Can anyone please let me know what you would run in production in
      terms of exception throwing?
      >
      Thanks,
      >
      Michael
      >
      To start with, is this the syntax you have in your php.ini file? It
      should be:
      >
      display_errors= on
      error_reporting =E_ALL
      (or E_ALL | E_STRICT)
      >
      Next, are you sure this is the php.ini file you're using? What does
      phpinfo() show for these settings and the php.ini file being used?
      >
      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstuck...@attgl obal.net
      =============== ===
      Hi Jerry,

      Thanks for your response. I have the following in my php.ini:

      error_reporting = E_ALL | E_STRICT
      display_errors = On

      The "Loaded Configuration File" is "C:\Program Files\PHP\php.i ni"

      phpinfo(); is showing:
      - display_errors: On
      - error_reporting :8191

      Michael

      Comment

      • Rik Wasmus

        #4
        Re: php.ini - errors not being thrown

        On Sat, 17 May 2008 16:00:49 +0200, Michael Sharman <sharmo@gmail.c om>
        wrote:
        Hi guys,
        >
        I'm somewhat new to PHP, so please excuse what I hope is an easy
        question.
        >
        I've experienced some issues lately where the code on my development
        environment throws no errors, but when I upload to a shared hosting
        server errors are thrown.
        >
        The latest was when I had output before calling header(); which should
        normally throw an error. As mentioned above, this threw no errors on
        my local machine but did only when I uploaded to another server.
        This could have something to do with output buffering locally and not on
        production? Or something like implicit_flush. ..
        My setup is:
        - PHP 5.2.5
        - Windows XP
        - Apache
        >
        The following is from my php.ini:
        - display_errors: On
        - error_reporting :8191
        >
        I also have error_reporting (E_ALL | E_STRICT); in my project.
        >
        Can anyone please let me know what you would run in production in
        Production would be run in E_ALL, with display_errors of and log_errors to
        a file of your choice.

        Some starters for hunting the reason down:
        1) Compare the phpinfo() output of your develelopment & production server.
        Any noticable differences?

        2) Are you sure this is not because differences unrelated to code
        directly? (like file permissions, installed extentions, database user
        permissions etc.)

        3) Is the error not shown, or simple not being thrown? Trigger_error()
        should tell you wether deliberate errors make it to your screen. For good
        measure, add a trigger_error() just after a point your production
        environment throws an error, so run-time settings are more or less as
        identical as you can get them. If it's just that the error doesn't exist,
        I refer you to option (2) )

        4) Any particular errors / common themes about the errors thrown?

        5) Is there a difference in PHP versions between development & production?

        6) Any calls set_error_handl er() / set_exception_h andler() anywhere in the
        code?
        --
        Rik Wasmus
        ....spamrun finished

        Comment

        Working...