Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

php syslog() not being logged

Discussion in 'Workarounds and Optimization' started by icishoot, Dec 25, 2016.

  1. icishoot

    icishoot Registered

    Jun 18, 2007
    Likes Received:
    Trophy Points:
    Good morning.

    I have been trying to get the wordpress plugin WP fail2ban to work, how ever the wordpress logins are not being entered into the system logs that I can see.

    I even did a simple php file that just called the syslog() function and wasn't able to find any evidence of it being in the logs.

    echo "Issuing a syslog test <br />";
    syslog(LOG_ERR, "SYSLOGTEST");
    echo "Done with test";
    Script echo's the strings like it should, but SYSLOGTEST does not show up in any logs.

    I'm not getting any errors in the php error logs.

    Hoping some one here has any idea as to how to fix it.

    The output from the command given in the guide to an effect thread:

    /etc/redhat-release:CentOS Linux Release 7.3.1611 (Core)
    /var/cpanel/envtype:xen pv
    Server Version: Apache/2.4/23 (cPanel)
    Server Built: Dec. 13 2016 13:28:05
    ea-php-cli Copyright 2016 cPanel, Inc
    PHP 5.6.29 (cli) (built: Dec 13 2016 13:49:19)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    mysql ver 14.14 Distrib 5.6.34, for linux (x86_64) using EditLine wrapper

    things I have tried:

    edit /etc/rsyslogd.conf -> change $OmitLocalLogging from on to off

    edit /etc/rsyslog.d/listen.conf:

    Default setting for $SystemLogSocketName is /run/systemd/journal/syslog.

    When I changed it to /dev/log, the logger command successfully entered my test message into the /var/log/messages log - but the php calls to syslog() (and even error_log) still didn't do any thing.

    under the default setting of /run/systemd/journal/syslog - the logger command doesn't do any thing.

  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    There's a third-party URL here that references this WordPress plugin's use with CentOS/RHEL 7.x:

    Wordpress Fail2Ban with CentOS 7 / EL7 - Xreflow

    While the installation steps are different, you may find some of the configuration details helpful.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice