Strict Standards: date() [function.date] Error
I was installing NagVis when I came across this weird message:
Strict Standards: date() [function.date]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘UTC’ for ‘GMT/0.0/no DST’ instead in /usr/local/nagios/nagvis/nagvis/includes/classes/objects/NagVisStatefulObject.php on line 360
It clearly says that I should check the timezone, which I did. But there’s nothing wrong with time or date. ntpd is running and it set the correct timezone so what could be wrong?
If you are reading this then probably you are seeing this error too. To fix this, open your php.ini using your favourite text editor (like vi) and add this line:
date.timezone=UTC
Take note that depending on how you installed php, it could be in /etc/php.ini (RedHat) or /etc/php5/apache2/php.ini (SLES) or if compiled, /usr/local/php5/php.ini.
You need to restart Apache for changes to take effect.
Common Linux Configuration Files
Every user who switches from Windows to Linux has the fear of editing configuration files using the command line interface (CLI). If you are one of those people, then I am here to guide you through the most common configuration files found in a Linux system. Please note that to be able to edit these files, you need to have knowledge in file editors such as vim or pico.
/etc/profile
System wide environment variables for all users.
/etc/fstab
List of devices and their associated mount points. Edit this file to add cdroms, DOS partitions and floppy drives at startup.
/etc/motd
Message of the day broadcast to all users at login.
/etc/rc.d/rc.local
Bash script that is executed at the end of login process. Similar to autoexec.bat in DOS.
/etc/hostname
Contains full hostname including domain.
/etc/cron.*
There are 4 directories that automatically execute all scripts within the directory at intervals of hour, day, week or month.
/etc/hosts
A list of all know host names and IP addresses on the machine.
/etc/httpd/conf
Parameters for the Apache web server
/etc/inittab
Specifies the run level that the machine should boot into.
/etc/resolv.conf
Defines IP addresses of DNS servers.
Sudo error: Sorry, you must have a tty to run sudo
From time to time, we perform remote actions on the servers that we manage, including, but not limited to, automated file transfers. For this, rsync is used to simplify the operation and until recently, I encountered this weird error:
sudo: sorry, you must have a tty to run sudo
But where on this bloody earth did that error came from? All was going well until a new server was added to the pool of money-making machines and powerful enough to throw me off guard. This can’t be happening! I own these machines, I built them from scratch and configured them exactly the way I built the other servers! I could not be any wrong-er, the server must be leading an uprising against me!
Okay, that was an exaggeration (or paranoia). But it is true that the server has the same configuration as the rest. Except for one little line of default configuration:
Defaults requiretty
Comment out this line in visudo (must be root to edit) and everything should checkout.
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- wayne donahue on Cebu Pacific Airlines is Evil!
- smeaferrepove on Howto: Install yum On RHEL 4
- Anidich1 on Tip: Add User and Generate Password Script
- Tom S on Cebu Pacific Sucks
- kadersardar on PinoyTux Spreads Some CommentLuv








