Discover Centmin Mod today
Register Now

PHP-FPM checkphp.sh - checking php disabled_functions

Discussion in 'Beta release code' started by eva2000, Aug 13, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    55,155
    12,249
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,825
    Local Time:
    5:30 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Thought I'd preview this in Beta release code forums.

    Playing around with a script, checkphp.sh to regularly check PHP error log for PHP warnings for disabled_functions which are being used by PHP scripts if you have set disabled_functions list in php.ini. Added both email and pushover.net notifications to the script thanks to @Matt heads up on pushover.net API usage Pushover | Centmin Mod Community :)

    checkphp.sh checks the php error logs filtered by current day, so you don't end up with duplicate notifications from previous days. Still a work in progress :)


    Code:
    /root/tools/checkphp.sh
    
    PHP Warning: exec usage detected
    PHP Warning: passthru usage detected
    PHP Warning: popen usage detected
    PHP Warning: proc_open usage detected
    PHP Warning: shell_exec usage detected
    PHP Warning: system usage detected
    
    check completed in .316732820 seconds
    pushover_phpdisabled_functions_notify.png