Dear All, Have used ISPConfig for a long while not, just installing the latest version as per the perfect server tutorial (CentOS 7.3). And whilst installing ISPConfig (And indeed after installing if I use the php date() function on a web script) I get the following error. "Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone." It doesnt matter what changes I make in /etc/php.ini - I get a custom php.ini created if I add date.timezone = 'Europe/London' inside Custom PHP.ini settings in ISPConfig the issue is rectified for that website only but I still get the error on command line scripts and websites that dont have any custom PHP.ini settings. Thank you kindly. Jim
There is probably another php.ini. Use the phpinfo() command in a commandline script to see which php.ini file is read by that script.
Hi Till, thank you for the quick reply. I ran phpinfo() and it says the configuration file being loaded is at /etc/php.ini - even other settings in php.ini do not seem to take effect though (IE; upload_max_filesize = 20M phpinfo() still shows upload_max_filesize as 2MB). I have installed 4 or 5 times just to make sure im not missing anything and all seems to be ok. Many Thanks, Jim
Do you run the script as shell user of a website? If yes, then this shell user is probably jailed and the php.ini it refers to is in the /etc/ diretory of that website and not the global /etc/ directory.
I am running the script through a web browser not shell script? I have searched the server for any other php.ini and this is what I am presented with :-
Hi Till, Just to let you know I have found some weird issue. If I create a new php.ini file and only add the line 'date.timezone = 'Europe/London' this setting is picked up by phpinfo() Just going to try a few other things but it is definitely reading settings from /etc/php.ini but not in its entirety. Thanks, Jim
It seems to work ok now after creating a new php.ini in /etc. Could have been a syntax issue with the original php.ini? This is across multiple servers
Stupid mistake by myself. In php.ini I had set error_reporting but missed an ampersand &... this must have caused syntax issue and now it’s working perfectly. Sorry to waste your time on this one!!