PHP debugging

Discussion in 'PHP and MySQL' started by Cosinus, Mar 18, 2011.

  1. Cosinus

    Cosinus Perch

    Hello,

    on my testing server (not set up by me) I get all my PHP errors (syntax errors, etc) in the page.

    However, uploading the PHP files on web5 all I get is a blank page. What's the best method to get, temporary at least, to see what errors the scripts produce?

    Neither
    error_reporting(E_ALL);
    nor
    ini_set("display_errors", "stdout");
    don't change anything.
  2. Stephen

    Stephen US Operations Staff Member

  3. aaliyahsmith

    aaliyahsmith Guppy

    Please be observant that if you do a comparison like ($error == UPLOAD_ERR_OK) you are NOT on the safe side! Because I executes a loop for all $_FILES entries. But if you only expect one file and you check $_FILE ['something']['error'] == UPLOAD_ERR_OK directly, it will true even if no file was uploaded, because the constant is zero!
    So please do $_FILE ['something']['error'] === UPLOAD_ERR_OK! Please be ready to act that if you do a comparison like ($error == UPLOAD_ERR_OK) you are NOT on the safe side!

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services