SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2006
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error_log() not working.

    I'm trying use the error_log for debugging instead of a remote file, unfortunately it doesn't seem to be working. I'm using:

    error_log("debug info", 0);

    When I go to my error log in cpanel, nothing is there. The PHP script seems to be working just fine as well, as no errors are outputted. So I'm not sure what the deal is.

    Thoughts?

  2. #2
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add this code to the top of your PHP files, and all messages/warnings should be shown.

    PHP Code:
    ini_set("display_errors""1");
    error_reporting(E_ALL); 
    Also make sure you have removed any @ from your functions or queries, because they supress important errors.
    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ini_set('error_log', 'path/to/your/desired/log');

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2006
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by F4nat1c
    Add this code to the top of your PHP files, and all messages/warnings should be shown.

    PHP Code:
    ini_set("display_errors""1");
    error_reporting(E_ALL); 
    Also make sure you have removed any @ from your functions or queries, because they supress important errors.
    That has no effect on my physically typing an error message into the error log.

    ini_set('error_log', 'path/to/your/desired/log');
    I am not trying to create a custom error log, I'm using the default log. Regular error are recorded just fine, but when I personally try to put text into the log using error_log(), nothing happens.

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i was thinking maybe they were being logged to a diff file than you were expecting. but if you say other php errors are being logged to that file, thats odd.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •