The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Massive Error Logs and Suhosin Errors

Discussion in 'General Discussion' started by fkatzenb, May 14, 2012.

  1. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    Sop I have finally found my source of slowly disappearing disk space. Looks like there are a lot of accounts with scattered error logs in various directories that contain this:
    Code:
    [14-May-2012 17:36:09] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so' - /usr/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
    What is the problem?

    Thanks!
    Frank
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Check to see if the following file exists on your system:

    Code:
    /usr/lib/php/extensions/no-debug-non-zts-20060613/suhosin.so
    If it does not exist, comment out the line referencing the path from the /usr/local/lib/php.ini file. You can then reinstall Suhosin via:

    Code:
    # /scripts/phpextensionmgr uninstall PHPSuHosin
    # /scripts/phpextensionmgr install PHPSuHosin
    Thank you.
     
  3. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    Michael,
    Do I comment out which of the following lines:
    Extension = suhosin.so, timezone.so
    Extension_dir = /usr/lib/php/extensions/no-debug-non-zts-20060613/

    That directory does contain timezone.so.
     
  4. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    bump...

    Thanks,
    Frank
     
  5. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    Frank,

    Just comment out suhosin.so. The only reason you are doing it is to get rid of your errors/warnings so your logs stop filling up. Right now Suhosin is not working for you, so there is no reason to keep that uncommented and cause the errors.

    ;Extension = suhosin.so, timezone.so
    Extension = timezone.so

    That's what I would do. Then, Michael suggested that you uninstall/reinstall using his instructions. If all goes well, Suhosin will be compiled, suhosin.so will be put in the proper extensions directory, and an Extension line for suhosin.so will be automatically added into the php.ini and you'll be good to go.

    Mike
     
  6. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    Thanks Mike! That did the trick.

    So my question to you is this.... what is the best method for searching for all error_log files within /home and deleting them. I found one that was 3.5GB!
     
  7. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    Frank,

    You're welcome. There are ways to remove specific lines from each and every error_log (so as not to delete the actual full log) - Unfortunately, I can't tell you how to do it -- I'd have to research it. And I'm sure such a task would take significant time to run on a server with lots of error_log fluff.

    Any of the options I give you below are likely to take some time before they give the commandline prompt back to you because it is searching a large section of the filesystem for files.

    To delete all files named error_log, forcefully, within the /home directory structure you can use the following. Since it's using rm -f, you should decide if you want to do it. I take no responsibility if you accidentally do something that deletes all of your filesystem :)

    Code:
    find /home -type f -name error_log | xargs rm -f
    
    I'd be careful of that one above. Do you really want to remove every error_log in your customer's directories? Some of them may actually make use of their error_log for troubleshooting.

    Maybe you should look at the size of them all first. Here's a line that will pipe a directory listing of all error_logs within /home to a file /root/errorlogs.txt. You can then view /root/errorlogs.txt with vi, nano, less, more, whatever.

    Code:
    find /home -type f -name error_log | xargs ls -alt > /root/errorlogs.txt
    
    Mike
     
  8. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    I went ahead and wiped them out. It is only about 50 customers and there is enough traffic that any issues would have been rerecorded in the log.

    Code:
    # find . -type f -name "error_log" -delete
    Thanks,
    Frank
     
  9. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    Thanks for that :) The " " so that it only matchs "error_log" and not "thisisnotanerror_log.txt". And, well, the -delete saves a step and is less likely to remove something you dont want remove if you accidentally type something additional in my rm -f command.

    As usual, I do the same thing, the same way, for years -- a creature of habit, when there are often more efficient, safer and sensible ways to do it. But I'll have to adopt the "-delete" and the "" around the filename.

    Mike
     
Loading...

Share This Page