Description
Note
Since Zabbix 5.2.0, it is no longer necessary to configure the timezone settings in the configuration files.
You can now set it within the Zabbix GUI, down the bottom left in the User Settings page,
or in Administration ⇾ Users ⇾ Username
The commands in this video are,
Ubuntu 20.04, 18.04
sudo nano /etc/zabbix/apache.conf
Centos 8, 7
sudo nano /etc/php-fpm.d/zabbix.conf
or
sudo nano /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
or
sudo nano /etc/httpd/conf.d/zabbix.conf
Note
If you get an error that nano is not installed,
Ubuntu:
sudo apt install nano
Centos 8:
yum install nano
Centos 7:
dnf install nano
Scroll down and uncomment the lines
# php_value date.timezone Europe/Riga
And edit to your time zone.
My time zone is London, so my line looks like,
php_value date.timezone Europe/London
PHP timezone strings can be found here,
https://www.php.net/manual/en/timezones.php
Warning
If you installed your Zabbix Server using the NGINX web server option then your time zone settings may be in the file /etc/php.d/99-zabbix.ini
Troubleshooting
Time zone for PHP is not set
Q. You see the error ‘Time zone for PHP is not set (configuration parameter “date.timezone”).’
A. You most likely didn’t remove the comment symbol (#) from the line containing php_value date.timezone and your time zone.
Cannot create the configuration file
Q. You get an error ‘unable to create the configuration file’ and you are then asked to download the configuration file and save it into a folder.
A. It is likely that the configuration file can no longer be automatically saved due to permissions between the web user running the Zabbix web interface and the operating system.
Download the file using the link as shown in the error screen and open it using a text editor, so you can see it.
The error screen also shows which folder to save the configuration into.
E.g.,
SSH onto your server, and cd
into the folder.
cd /usr/share/zabbix/conf
Edit the file
sudo nano zabbix.conf.php
Paste the contents of the file that you downloaded locally into the Nano view. If using the Putty ssh client, you can right-click the mouse and the clipboard will be pasted in.
In Nano, press ctrl-X
and y
to save.
Press [next] on the error screen and continue with the login process.
Preface
Follow the problem encountered in the previous blog, to solve it. After completing the installation on the zabbix-server side, the above problem occurred because there was a problem with the time zone in our configuration file. The system defaults to the European time zone and we need to change it to the Shanghai time zone.
1. View and modify the configuration of the php.ini configuration file
vi /etc/php.ini
Before the change
After the change
After the change
Note:
date.timezone =Asia/Shanghai //Remove the semicolon at the top and change the time zone above to Asia Shanghai.
2. View and modify the configuration of the /etc/httpd/conf.d/zabbix.conf configuration file
vi /etc/httpd/conf.d/zabbix.conf
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Shanghai //Modify time zone
Before the change
After the change
3. Restart the httpd service
service httpd restart
I’m trying to install Zabbix on Ubuntu Server 16.
I’ve followed all the instructions here:
https://www.zabbix.com/download?zabbix=3.4&os_distribution=ubuntu&os_version=xenial&db=PostgreSQL
but, I’m not able to find the apache configuration for zabbit, as described in the last point, in order to set the right date.timezone. Infact I’m able to run http://my_ip/zabbix web interface, but on the second step, Check of pre-requisites, I get the following error: Time zone for PHP is not set (configuration parameter “date.timezone”). Is the only fail in the pre-requisites.
The file /etc/httpd/conf.d/zabbix.conf doesn’t exist and I don’t know how to set the following
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga
in the apache2.conf
Any suggestion on how and where to set the above value?
asked Feb 5, 2018 at 23:39
0
I had the same issue on Ubuntu 14.04.4 and I have the set the values in /etc/php5/apache2/php.ini
as below.
You can also edit /etc/apache2/conf-enabled/zabbix.conf
which is simlink to /etc/zabbix/apache.conf
:
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone America/Denver
Kalle Richter
5,87620 gold badges68 silver badges100 bronze badges
answered Feb 19, 2018 at 10:27
MohanMohan
262 bronze badges
I would assume you would need to create the file with an editor …
sudo vi /etc/httpd/conf.d/zabbix.conf
(you also use nano
or another editor) and then insert the options you listed. After the empty file is show type an “i” to insert new lines and then copy/paste below settings. And then esc
, w, q to exit edit mode, save (w) and quit (q):
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga
answered Feb 19, 2018 at 10:32
RinzwindRinzwind
291k39 gold badges564 silver badges704 bronze badges
It seems file paths tend to change a lot over the years, and documentation doesn’t stay up-to-date. Even the currently accepted answer here doesn’t seem to be right anymore (though I’m on Ubuntu 18.04 now).
Today, the file you need to edit is /etc/apache2/conf-available/zabbix-frontend-php.conf
. And the install instructions don’t mention this, but you’ll need to create a symlink to the conf-enabled
directory, like so:
ln -s /etc/apache2/conf-available/zabbix-frontend-php.conf
/etc/apache2/conf-enabled/zabbix-frontend-php.conf
Also, nowadays there are two identical lines in this file that you need to uncomment and edit. Don’t just edit the first one you see.
answered Aug 22, 2019 at 10:30
PhilPhil
3011 gold badge4 silver badges8 bronze badges
Current install of Zabbix 5.0.1 on Ubuntu 20.04. The paths and files have changed.
Edit the /etc/zabbix/apache.conf and make sure you uncomment both instances of the php_value date.timezone variable.
answered Jul 2, 2020 at 15:09
tags: zabbix
Solution:
1, vim /etc/opt/rh/rh-ph-php72/php-fpm.d/zabbix.conf Open this profile
php_value[date.timezone] = Asia/Shanghai
2, restart PHP
systemctl restart rh-php72-php-fpm
Intelligent Recommendation
Set mysql time zone
In the server environment (Linux or Docker), sometimes the system time zone is the UTC time zone by default, and it is necessary to pay special attention to the time zone information used. When using …
Centos set time zone
First, check the time zone Second, modify the time zone 2.1 Modify Profile Files 2.2 Modify the time zone file…
php time zone problem
Encountered a very strange problem today: The date information stored in the database is a timestamp,After taking out the date information in the database with php and converting it to “Y-…
php time zone problem
Recently I encountered time zone problems while learning php, so don’t talk nonsense about the code. . 1. Use date_default_timezone_set() in the header to set my default time zone to Beijing time date…
More Recommendation
Timestamp and time zone in PHP
Timestamp The timestamp refers to the total number of seconds since 00:00:00, January 1, 1970, Greenwich Mean Time (08:00, 01:01, 1970, Beijing Time) to the present. Time zone Since the longitu…
PHP setting time zone
After installation of the PHP module, if there is no correct time zone, any feature related to PHP and date will be used in the future, the PHP engine will prompt a warning, in order to avoid unnecess…
Linux set time zone and time
Take India Time Zone as an Example: Time zone setting Modify time zone Instantly take effect Modify system time Time setting: hwclock -s Write hardware time to system time …
Related Posts
- Zabbix5.0 error PHP time zone is not set (configuration parameters “date.timezone”)
- Set PHP time zone Date.Timezone on OSX
- PHP time zone configuration
- PHP query time zone and set time zone
- Set time zone method in PHP
- Set the current PHP time zone
- Debian 8 Set time zone and time configuration
- (Reproduced) set time zone method in PHP
- Set time zone
- Centos set time zone
Popular Posts
- Review cross-domain
- BZOJ.1022.[SHOI2008] Little John’s game John (Game Theory Anti-Nim)
- My programming, vegetable vegetables
- (Look at it) The difference between JavaScript ES6 – Var, Let, Const
- Web front-end learning – basic articles (12) _CSS common style, text text properties, text properties
- Maximum number of sub-arrays
- Smarty template
- Select object __ drop-down box object __select__ get random subscript
- IOS Third Party Map – Baidu Map Center Point Position
- MATPLOTLIB Basic Introduction
Recommended Posts
- [ ] FFMPEG acquisition equipment
- Home: Integrating dev-Tools rendering first class classification data
- LeetCode117 Right to Right to Right to Pointer II
- hihocoder-Weekly224-Split Array
- GREP zero-wide assertion
- One of JQuery Ajax
- Talking about Rollback
- Zabbix remote execution script
- php xdebug configuration
- AMD CPU Performance Analysis
Related Tags
- Zabbix monitoring
- PHP
- Time zone
- Linux
- Centos
- EF
- MySQL
- system
- CentOS
- ubuntu
Solution:
#1. Edit the file /etc/opt/rh/rh-php72/php-fpm.d/zabbix.con, uncomment and set to the local time zone
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
#2. Restart PHP after modification (remember)
systemctl restart rh-php72-php-fpm
#3. If you log in again, you won’t report an error