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.

error_log not working

Discussion in 'General Discussion' started by Darkfox, Jun 26, 2016.

Tags:
  1. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    So installing WHMCS and the client area throws a 500 internal server error.

    I've followed their install steps, and the cPanel is a totally vanilla, freshly installed setup.

    So I have the one account, there should be error_log files being generated in each folder that a failed script runs from. I have the following error_log files on my system:

    $ sudo find / -name "error_log"
    /usr/local/cpanel/logs/error_log
    /usr/local/apache/logs/error_log

    No, there's nothing in there relating to my 500 errors.

    Figured it wasn't configured, buuut:
    # cat /usr/local/lib/php.ini | grep -E "(^error_log|^display_errors|^log_erro)"
    display_errors = On
    log_errors = On
    log_errors_max_len = 1024
    error_log = "error_log"


    Ontop of this, under cPanel -> Metrics -> Errors, I see a blank box (not blank page, the error log box thingy is blank and hovering over it changes the cursor to a crossed icony thing). That said, it's sooking about my info.php file, so I guess somethings being logged somewhere but not in the public_html directory.

    Let me know if I can send over any other config's you need to see, but for some reason, I'm seeing no error_log files on a vanilla fresh cpanel install.

    Just one of so many issues I've had trying to get cpanel setup this time :(
     
  2. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Hi Darkfox,

    Errors such as this should be displayed in the /usr/local/apache/logs/error_log or at very least in the error_log under the websites directory that is automatically created for most php applications.

    As far as whmcs not loading, I assume you did not install ioncube loader yet if this is a new install. I would verify that this has been done through EasyApache as without it, whmcs will not load.

    In regards to that blank errors page in the metrics section, to be quite honest with you, I have never looked at errors that way, but rather with /usr/local/apache/logs/error_log.

    Me personally, due to the amount of sites on my servers, I run the following:

    tail -f /usr/local/apache/logs/error_log

    And with this command, I can reaccess the page and normally the most recent line added to the log is my problem. In addition, you can always grep for the username of the account with a command such as:

    cat /usr/local/apache/logs/error_log; grep accountusernamehere
     
    #2 JayFromEpic, Jun 26, 2016
    Last edited: Jun 26, 2016
  3. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Also, here is a logs poster that I was given way back when I was working at HostGator, it may help you out!
     

    Attached Files:

  4. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    Hi Yehzo, cheers for the reply!

    IonCube is definitely installed. WHMCS has installed fine, however post-install I can't access the client area. I'm sure it's a super simple issue, but it's impossible to debug without an error log.

    /usr/local/apache/logs/error_log doesn't appear to have anything relevant in there, the last four lines:
    $ tail -fF /usr/local/apache/logs/error_log
    [Mon Jun 27 02:01:34.003895 2016] [core:notice] [pid 20222] AH00094: Command line: '/usr/local/apache/bin/httpd'
    [Mon Jun 27 07:12:57.002389 2016] [mpm_prefork:notice] [pid 20222] AH00163: Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 configured -- resuming normal operations
    [Mon Jun 27 07:12:57.002415 2016] [core:notice] [pid 20222] AH00094: Command line: '/usr/local/apache/bin/httpd'
    (XID q7nmja) Access denied for user 'leechprotect'@'localhost' (using password: YES)

    Grepping through I can see the following issue:

    [Mon Jun 27 01:22:45.711857 2016] [:error] [pid 4213] [client 211.30.157.70:55794] SoftException in Application.cpp:256: File "/home/accountname/public_html/test.php" is writeable by group

    So it can write to the file, but for some reason 500's aren't being recorded anywhere.

    I'll have a gander at it soon :) Thanks for sending it over!

    Edit: I can't see the test when I open it :(
     
  5. twhiting9275

    twhiting9275 Well-Known Member

    Joined:
    Sep 26, 2002
    Messages:
    538
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Code:
    chmod 600 /home/accountname/public_html/*.php
    
    That will solve that
    Also, take a look in the WHMCS directory for error_logs . This will sometimes be helpful[/code]
     
  6. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    Thats the whole thing @twhiting9275 , there are no error_log files being written, despite php/apache appearing to be configured for such behavior.


    The public_html directory for the user account:
    Code:
    # ls -la
    total 780
    drwxr-x--- 19 user nobody   4096 Jun 27 11:25 .
    drwx--x--x 13 user user    4096 Jun 27 11:04 ..
    drwxr-xr-x  5 user user    8192 Apr 11 17:34 admin
    -rw-r--r--  1 user user   17445 Apr 11 17:34 affiliates.php
    -rw-r--r--  1 user user    1331 Apr 11 17:34 aff.php
    -rw-r--r--  1 user user   12833 Apr 11 17:34 announcements.php
    -rw-r--r--  1 user user    7326 Apr 11 17:34 announcementsrss.php
    drwxr-xr-x  6 user user      47 Apr 11 17:34 assets
    drwxrwxrwx  2 user user      22 Apr 11 17:34 attachments
    -rw-r--r--  1 user user    6596 Apr 11 17:34 banned.php
    -rw-r--r--  1 user user  104297 Apr 11 17:34 cart.php
    drwxr-xr-x  2 user user       6 Jun 26 23:02 cgi-bin
    -rw-r--r--  1 user user  144313 Apr 11 17:34 clientarea.php
    -rw-r--r--  1 user user     328 Jun 27 01:02 configuration.php
    -rw-r--r--  1 user user   20679 Apr 11 17:34 configuressl.php
    -rw-r--r--  1 user user   10005 Apr 11 17:34 contact.php
    -rw-r--r--  1 user user   17324 Apr 11 17:34 creditcard.php
    drwxr-xr-x  2 user user     148 Apr 11 17:34 crons
    -rw-r--r--  1 user user    1509 Apr 11 17:34 dist.loghandler.php
    -rw-r--r--  1 user user   22584 Apr 11 17:34 dl.php
    -rw-r--r--  1 user user   11127 Apr 11 17:34 dologin.php
    -rw-r--r--  1 user user   23168 Apr 11 17:34 domainchecker.php
    drwxrwxrwx  2 user user      22 Apr 11 17:34 downloads
    -rw-r--r--  1 user user   16205 Apr 11 17:34 downloads.php
    drwxr-xr-x  2 user user    4096 Apr 11 17:34 feeds
    drwxr-xr-x  5 user user    4096 Apr 11 17:34 includes
    -rw-r--r--  1 user user   12748 Apr 11 17:34 index.php
    -rw-r--r--  1 user user   14803 Apr 11 17:34 init.php
    -rw-r--r--  1 user user   29328 Apr 11 17:34 knowledgebase.php
    drwxr-xr-x  2 user user    4096 Apr 11 17:34 lang
    -rw-r--r--  1 user user    5101 Apr 11 17:34 link.php
    -rw-r--r--  1 user user    6207 Apr 11 17:34 login.php
    -rw-r--r--  1 user user    6260 Apr 11 17:34 logout.php
    drwxr-xr-x 12 user user    4096 Apr 11 17:34 modules
    -rw-r--r--  1 user user   10831 Apr 11 17:34 networkissues.php
    -rw-r--r--  1 user user    6523 Apr 11 17:34 networkissuesrss.php
    drwxr-xr-x  2 user user    4096 Apr 11 17:34 oauth
    drwxr-xr-x  2 user user      51 Apr 11 17:34 pipe
    -rw-r--r--  1 user user    6811 Apr 11 17:34 pwreset.php
    -rw-r--r--  1 user user   10065 Apr 11 17:34 register.php
    drwxr-xr-x  3 user user      16 Apr 11 17:34 resources
    -rw-r--r--  1 user user   10292 Apr 11 17:34 serverstatus.php
    drwxr-xr-x  2 user user      22 Apr 11 17:34 status
    -rw-r--r--  1 user user   20987 Apr 11 17:34 submitticket.php
    -rw-r--r--  1 user user   14167 Apr 11 17:34 supporttickets.php
    drwxr-xr-x  5 user user      60 Apr 11 17:34 templates
    drwxrwxrwx  2 user user    4096 Jun 27 01:06 templates_c
    -rw-r--r--  1 user user     784 Apr 11 17:34 txt.htaccess
    -rw-r--r--  1 user user    7111 Apr 11 17:34 unsubscribe.php
    -rw-r--r--  1 user user   22434 Apr 11 17:34 upgrade.php
    drwxr-xr-x 26 user user    4096 Apr 11 17:34 vendor
    -rw-r--r--  1 user user    6280 Apr 11 17:34 viewemail.php
    -rw-r--r--  1 user user   10807 Apr 11 17:34 viewinvoice.php
    -rw-r--r--  1 user user   14921 Apr 11 17:34 viewquote.php
    -rw-r--r--  1 user user   25632 Apr 11 17:34 viewticket.php
    -rw-r--r--  1 user user    6661 Apr 11 17:34 whois.php
    
    Apart from commenting out the sql_mode in /usr/lib/my.cnf and installing ioncube using easyapache, I have made no changes to the base install.

    The SoftException can be ignored because it's just a quick script I made to phpinfo() and check ioncube is loaded.

    Not too sure why error_log isn't being written :\
     
  7. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Ok, I noticed that your directories are set with permissions 777. Depending on which php handler you are using, this can be either correct or incorrect. If you are using suphp, you will need to change these to permission 755.

    If you are running suphp, you can run the following commands to correct he permissions. These should be ran in the /home/user/public_html directory. If you run these in the home directory of the account, you will destroy all of the permissions that cpanel uses.

    Find all directories under the directory you are in and set to correct (755) permissions:

    find . -type d -exec chmod 755 {} \;


    Find all files in the directory and all sub directories and set to correct (644) permissions:

    find . -type f -exec chmod 644 {} \;

    Again, execute this in the /home/user/public_html directory!
     
  8. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    Updated file permissions as per your recommendation but still getting the 500 error.

    The specific issue is that I have no client-facing error reporting. If I were to sign someone up for this service, and provide them cPanel hosting, they will not be able to debug faulty scripts. This - to me - is quite a massive issue.

    I created a simple php script; <?php echo asd; ?>, built to fail. I don't get an error_log entry, but I do get an "end of script" error in /usr/local/apache/logs/error_log

    That's all well and good, but clients can't access that.

    I'm submitting a ticket now, but I would like the solution publicly available for the next poor soul that has to Google this **** out of this :(
     
  9. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Can you please copy and paste the error reporting section of your php.ini file please. It could very well be an issue with the type of error not set to be reported. As well, what pho handler are you using? If it's an issue with permissions not being set right, the error log would not create itself as well.
     
  10. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    From my problematic server:

    Code:
    # php -v
    PHP 5.5.36 (cgi-fcgi) (built: Jun 27 2016 02:01:14)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
        with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.1.1, Copyright (c) 2002-2016, by ionCube Ltd.
    Code:
    [PHP]
    engine = On
    short_open_tag = On
    asp_tags = Off
    precision    =  12
    output_buffering = Off
    zlib.output_compression = Off
    implicit_flush = Off
    unserialize_callback_func=
    serialize_precision = 100
    disable_functions =
    disable_classes =
    expose_php = On
    max_input_vars = 1000
    error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
    display_errors = On
    display_startup_errors = Off
    log_errors = On
    log_errors_max_len = 1024
    ignore_repeated_errors = Off
    ignore_repeated_source = Off
    report_memleaks = On
    track_errors = Off
    error_log = error_log
    variables_order = "EGPCS"
    register_argc_argv = On
    post_max_size = 8M
    gpc_order = "GPC"
    auto_prepend_file =
    auto_append_file =
    default_mimetype = "text/html"
    include_path = ".:/usr/lib/php:/usr/local/lib/php"
    doc_root =
    user_dir =
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20121212"
    zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.5.so"
    enable_dl = On
    file_uploads = On
    upload_max_filesize = 2M
    allow_url_fopen = On
    default_socket_timeout = 60
    [Syslog]
    [mail function]
    smtp_port = 25
    sendmail_path = "/usr/sbin/sendmail -t -i"
    

    Code:
    # /usr/local/cpanel/bin/rebuild_phpconf --current
    Available handlers: suphp dso cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: suphp
    SUEXEC: enabled
    RUID2: not installed
    
    I thought it might be a permissions issue as well but this permissions scheme was worked in the past and I don't get why it wouldn't work now.

    For example, on my working cPanel server, I have the following permissions set working fine:

    Code:
    [/home/clientname/public_html/subdom]# ls -la
    total 56
    drwxr-xr-x  10 clientname clientname 4096 Apr 26 06:08 ./
    drwxr-xr-x.  9 clientname clientname 4096 Jun 27 00:23 ../
    -rw-r--r--   1 clientname clientname  877 Apr 26 16:08 aboutus.php
    drwxrwx--x   2 clientname clientname 4096 Apr 26 04:38 cache/
    -rw-r--r--   1 clientname clientname 1034 Dec 21  2015 composer.json
    drwxr-xr-x   2 clientname clientname 4096 Apr 26 06:08 configs/
    -rw-r--r--   1 clientname clientname  668 Apr 26 04:33 error_log
    -rw-r--r--   1 clientname clientname 1088 Apr 26 14:38 index.php
    drwxr-xr-x   2 clientname clientname 4096 Apr 26 06:08 lexer/
    drwxr-xr-x   4 clientname clientname 4096 Apr 26 06:08 libs/
    drwxr-xr-x   2 clientname clientname 4096 Apr 26 06:08 plugins/
    drwxr-xr-x   2 clientname clientname 4096 Apr 26 16:01 sql/
    drwxr-xr-x   5 clientname clientname 4096 Apr 26 06:09 templates/
    drwxrwx--x   2 clientname clientname 4096 May 12 04:28 templates_c/
    
    We can see error logs in here, and the parent permissions:

    Code:
    [/home/clientname/public_html]# ls -la
    total 212
    drwxr-xr-x.  9 clientname clientname  4096 Jun 27 00:23 ./
    drwx--x--x. 14 clientname clientname  4096 May 15 14:40 ../
    drwxr-xr-x  11 clientname clientname  4096 May  4 09:53 subdom2/
    drwxr-xr-x  10 clientname clientname  4096 Apr 26 06:08 subdom/
    -rw-r--r--.  1 clientname clientname   235 Mar 23 00:20 .htaccess
    -rw-r--r--.  1 clientname clientname   418 Sep 25  2013 index.php
    drwxr-xr-x   3 clientname clientname  4096 Apr 27 13:29 ip/
    -rw-r--r--.  1 clientname clientname 19930 Jan  2 03:48 license.txt
    drwxr-xr-x   3 clientname clientname  4096 May  3 00:43 newclientname/
    -rw-r--r--.  1 clientname clientname  7360 Jun 21 17:37 readme.html
    -rw-r--r--.  1 clientname clientname  5035 Oct  6  2015 wp-activate.php
    drwxr-xr-x.  9 clientname clientname  4096 Feb  2 17:11 wp-admin/
    -rw-r--r--.  1 clientname clientname   271 Jan  8  2012 wp-blog-header.php
    -rw-r--r--.  1 clientname clientname  1369 Oct  3  2015 wp-comments-post.php
    -rw-rw-rw-.  1 clientname clientname  3129 Mar 23 00:20 wp-config.php
    -rw-r--r--.  1 clientname clientname  2853 Dec 16  2015 wp-config-sample.php
    drwxr-xr-x.  7 clientname clientname  4096 Jun 23 12:46 wp-content/
    -rw-r--r--.  1 clientname clientname  3286 May 24  2015 wp-cron.php
    drwxr-xr-x. 16 clientname clientname 12288 Apr  1 18:54 wp-includes/
    -rw-r--r--.  1 clientname clientname  2380 Oct 24  2013 wp-links-opml.php
    -rw-r--r--.  1 clientname clientname  3316 Nov  5  2015 wp-load.php
    -rw-r--r--.  1 clientname clientname 33770 Dec 21  2015 wp-login.php
    -rw-r--r--.  1 clientname clientname  7887 Oct  6  2015 wp-mail.php
    -rw-r--r--.  1 clientname clientname 13021 Nov 20  2015 wp-settings.php
    -rw-r--r--.  1 clientname clientname 28594 Oct 30  2015 wp-signup.php
    -rw-r--r--.  1 clientname clientname  4035 Nov 30  2014 wp-trackback.php
    -rw-r--r--.  1 clientname clientname  3061 Oct  2  2015 xmlrpc.php
    

    It's PHP setup is kinda different because I haven't done the easyapache rebuild on it. The cpanel server itself was a test server so I didn't really put any effort in to make it usable ;)
    Code:
    # php -v
    PHP 5.5.33 (cli) (built: Mar 22 2016 04:19:54)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    
    Code:
    [PHP]
    engine = On
    short_open_tag = On
    asp_tags = Off
    precision    =  12
    output_buffering = Off
    zlib.output_compression = Off
    implicit_flush = Off
    unserialize_callback_func=
    serialize_precision = 100
    disable_functions =
    disable_classes =
    expose_php = On
    max_input_vars = 1000
    error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
    display_errors = On
    display_startup_errors = Off
    log_errors = On
    log_errors_max_len = 1024
    ignore_repeated_errors = Off
    ignore_repeated_source = Off
    report_memleaks = On
    track_errors = Off
    error_log = error_log
    variables_order = "EGPCS"
    register_argc_argv = On
    post_max_size = 8M
    gpc_order = "GPC"
    auto_prepend_file =
    auto_append_file =
    default_mimetype = "text/html"
    include_path = ".:/usr/lib/php:/usr/local/lib/php"
    doc_root =
    user_dir =
    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20121212"
    zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.5.so"
    enable_dl = On
    file_uploads = On
    upload_max_filesize = 2M
    allow_url_fopen = On
    default_socket_timeout = 60
    [Syslog]
    [mail function]
    smtp_port = 25
    sendmail_path = "/usr/sbin/sendmail -t -i"
    
    Code:
    # /usr/local/cpanel/bin/rebuild_phpconf --current
    Available handlers: suphp dso cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: suphp
    SUEXEC: enabled
    RUID2: not installed
    
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Are you able to reproduce the issue with other test scripts on other accounts, or is it isolated to WHMCS? Please keep in mind that issues with WHMCS are better directed to their support forums at:

    WHMCS Community Forums

    Thank you.
     
  12. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    I'm currently working with one of your support team members. Fantastic bloke to put up with me so far :) If we reach a point where it's best suited to the WHMCS, I'll give them a shot.

    Still trying to work out the cause, I'll update this thread once we work it out.

    Cheers
    Jacob.
     
  13. Darkfox

    Darkfox Member

    Joined:
    Jun 10, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Sydney Australia
    cPanel Access Level:
    Root Administrator
    Not to leave a thread un-updated; I raised this issue with cPanel support who went through and debugged the server for me.

    Replication of the error:
    - Vanilla cPanel installation, default EasyApache Profile + IonCube 5.1
    - MySQL Strict Mode disabled\
    - Database setup wthrough WHMCS
    - Using File Manager, Upload WHMCS to public_html, change configuration file name, run installer.
    - Access WHMCS, 500 error.
    - Chmod 644 all the files in side public_html, WHMCS claims it can't load a class.

    This is where I kind of got stuck.

    I went to my other, older cpanel server and tried installing WHMCS. No issues at all worked just the way it was.

    I compared the servers a bit but didn't see any differing modules or anything. The ticket was escalated to Level 3 who logged in, changed the memory limit, and everything was working.

    ... yeahp. You heard right.

    As stated by Peter@cPanel, WHMCS requires a 64MB memory limit and not a 32MB memory limit. This - for some reason - throws you weird 500 server messages that don't tell you that you're running out of memory.

    So there you have it :)

    Edit: Just have to say that as always, cPanel support have been second to none. I can't thank them enough for identifying this issue and resolving it for me, and I really help the work here can help other users in the future who might have missed that memory limit option and are searching dead, unanswered WHMCS articles like I was.
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    I'm happy to see the issue is now resolved. Thank you for updating this thread with the outcome so that anyone else experiencing the same issue is able to see the resolution.
     
Loading...

Share This Page