Welcome to Centmin Mod Community
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

    30,164
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    12:19 AM
    Nginx 1.13.x
    MariaDB 5.5
    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