-->

DEVOPSZONES

  • Recent blogs

    Fix cacti php timezone Error “A valid timezone that matches MySQL and the system”

    Fix cacti php timezone Error “A valid timezone that matches MySQL and the system” 

    When installing cacti you may come across these below 2 PHP errors related to a timezone which will prevent you from installation CACTI.

    This is a simple fix that involves editing the php.ini for PHP and php.ini file for PHP CLI.

    Fix cacti php timezone Error
    cacti-timezone-error

    The PHP.ini files are located in these 2 directories on a Debian based system.

    /etc/php/7.4/apache2/php.ini

    /etc/php/7.4/cli/php.ini

    If you still find the difficulties finding the file, please find them using following command.

    Find the php.ini file:

    find / -name php.ini

    Now once you have located the files we need to add the timezone to them to fix this error. we will need to uncomment the date.timezone directive and add our timezone. Do this for both the files.

    root@cactiserver:~# grep timezone /etc/php/7.4/cli/php.ini

    date.timezone = "Asia/Calcutta"

    After you finish editing the file you must restart the apache process.

    systemctl restart apache2

    Check the apache2 status.

    systemctl status apache2

    apache_service_status
    apache_service_status

    Now let’s check the installer to see if the error has cleared.

    cacti_error_cleared
    cacti_error_cleared

    Hope this Helps. Sharing is careing.

    3 comments: