Want more timely Centmin Mod News Updates?
Become a Member

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

    50,481
    11,664
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,092
    Local Time:
    3:10 AM
    Nginx 1.25.x
    MariaDB 10.x
    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