• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP Date Function

CJZ

Basic Pleskian
After upgrading to Plesk Panel 10.3, each subscription running as a CGI or FastCGI module now gives a PHP error for the date handling.

Code:
Warning: date() [function.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 'America/New_York' for 'EST/-5.0/no DST' instead in /var/www/vhosts/.../httpdocs/libraries/joomla/utilities/date.php on line 198

The timezone is set in the server's php.ini. How can I fix this problem and still have the sites hosted as CGI?
 
Last edited:
Make sure that you have in php.ini:

session.auto_start = 0
 
The following is already indicated in the php.ini

Code:
; Initialize session on request startup.
session.auto_start = 0
 
I am running on a Centos 5 linux which seems to have the CGI /Apache/ FCGI all run from the same global php.ini (/etc/php.ini). I also have the following stated in the php.ini:
Code:
[Date]
; Defines the default timezone used by the date functions
date.timezone = America/New_York

Apache service has been rebooted after applying the time zone. The sites work running under apache, I need them to run under CGI.

Thanks.
 
Here are all the error codes that appear on my site(s) when they are running as a CGI or FCGI script.

Code:
arning: strtotime() [function.strtotime]: 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 'America/New_York' for 'EST/-5.0/no DST' instead in /var/www/vhosts/.../httpdocs/libraries/joomla/utilities/date.php on line 56

Warning: date() [function.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 'America/New_York' for 'EST/-5.0/no DST' instead in /var/www/vhosts/z.../httpdocs/libraries/joomla/utilities/date.php on line 198

Warning: date() [function.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 'America/New_York' for 'EST/-5.0/no DST' instead in /var/www/vhosts/.../httpdocs/libraries/joomla/utilities/date.php on line 198

I need help correcting this issue as soon as possible. Thank you.

Feel free to ask for more information on the server configuration if it'll help with the solution.


-->> EDIT <<--

After further searching, when they are running as a CGI/FCGI script they pull the php.ini from ../vhosts/.../etc/php.ini for each site. How can these easily be managed or have it stay pointed at the master php.ini?
Code:
Server API	CGI/FastCGI
Virtual Directory Support	disabled
Configuration File (php.ini) Path	/etc
Loaded Configuration File	/var/www/vhosts/z.../etc/php.ini

Also, the php.ini files are root:root so they cannot be modifies in the Plesk file manager for the users.
 
Last edited:
Back
Top