Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (37 sloc) 1.86 KB

autobuild_php.sh

This script will fully automated build the latest PHP-FPM and run it as systemd service. Useful if the os version does not meet your requirements.

Install

Tested under Debian 9,10 / Ubuntu 18.04,19.04 / CentOS 7

  1. download autobuild_php.sh
  2. run it: bash autobuild_php.sh install
  3. check if everything is fine in the summary
  4. the script has been moved to /usr/local/bin/autobuild_php.sh
  5. make your own settings: /opt/php-7.3/etc/php-fpm.conf | /opt/php-7.3/etc/php-fpm.d/www.conf

Update

  1. run the script to check if a new version is available: autobuild_php.sh update
  2. if so, answer with "y" to update

Nagios Plugin (optional)

NRPE Node

  1. make the nagios plugin script executable: chmod +x check_php_update
  2. move it to the plugin directory mv check_php_update /usr/lib/nagios/plugins/
  3. add this line command[check_php_update]=/usr/lib/nagios/plugins/check_php_update to /etc/nagios/nrpe.cfg
  4. restart nagios nrpe service: systemctl restart nagios-nrpe-server.service

Nagios Node

define service{
        use                             generic-service
        host_name                       example.com
        service_description             PHP Update
        check_command                   check_nrpe_1arg!check_php_update
        }

Systemd Timer (optional)

daily php version update check:

  1. install systemd timer: autobuild_php.sh installcron your@mailaddress.com
  2. verify that your system is able to send mails!
  3. systemd timer and service file has been created
  4. timer has been started

Cronjob (optional)

daily php version update check:

  1. add this line to your cronjobs 0 3 * * * (/usr/local/bin/autobuild_php.sh cron) > /dev/null
You can’t perform that action at this time.