| Author |
Message |
|
gymmic
|
Post subject: PHP Warning : date() [function.date] Posted: Wed May 02, 2012 9:34 pm |
|
Joined: Wed May 02, 2012 9:27 pm Posts: 5
|
|
Hello. I am taking this web app for a spin. So far it seems pretty darn awesome. Throughout the installation process, I have been getting these PHP warnings, and wanted to know if there was a way to resolve this.
This is the latest one:
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/Los_Angeles' for 'PDT/-7.0/DST' instead in /Library/WebServer/Documents/Phreedom/includes/common_classes.php on line 319
I was also seeing it while calling the pre_process.php on line 411
Thanks,
update. I have made the necessary adjustments to the php.ini for my local server. issue is still persisting. Any thoughts?
here is the current error I am trying to tackle:
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/Los_Angeles' for 'PDT/-7.0/DST' instead in /Library/WebServer/Documents/Phreedom/includes/common_classes.php on line 319
Last edited by gymmic on Thu May 03, 2012 3:32 pm, edited 1 time in total.
|
|
 |
|
 |
|
gymmic
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Thu May 03, 2012 3:29 pm |
|
Joined: Wed May 02, 2012 9:27 pm Posts: 5
|
|
I have made the necessary changes in the php.ini file, and this is still popping up. Any thoughts?
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/Los_Angeles' for 'PDT/-7.0/DST' instead in /Library/WebServer/Documents/Phreedom/includes/common_classes.php on line 319
Appreciate all your help/
|
|
 |
|
 |
|
hucka
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Tue May 08, 2012 12:12 pm |
|
Joined: Wed Sep 21, 2011 11:42 am Posts: 93 Location: Brno, Czech Republic
|
The solution is quite simple. It is the issue with the php upgrade. In the recent PHP versions you have to explicitly set the time zone in the php.ini file. Just find the line with date.timezone statement, uncomment it and set your timezone. Code: date.timezone = "Europe/Prague"
Then restart apache and check, if is your problem fixed. Rosta
|
|
 |
|
 |
|
gymmic
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Wed May 23, 2012 11:34 pm |
|
Joined: Wed May 02, 2012 9:27 pm Posts: 5
|
I made the necessary changes, and restarted apache. The error is still there. here are the changes I made to the php.ini file: [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone;date.timezone = Americas/Los_Angeles; The error still appears. 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/Los_Angeles' for 'PDT/-7.0/DST' instead in /Library/WebServer/Documents/Phreedom/includes/common_classes.php on line 319 Here is the code on line 319: function debug_header() { $this->debug_info .= "Trace information for debug purposes. Phreedom release " . MODULE_PHREEDOM_VERSION . ", generated " . date('Y-m-d H:i:s') . ".\n\n"; $this->debug_info .= "\nGET Vars = " . arr2string($_GET); $this->debug_info .= "\nPOST Vars = " . arr2string($_POST); I am assuming the issue is with the data() function that is being called in the above line.
|
|
 |
|
 |
|
dave
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Sun May 27, 2012 7:53 am |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
Quote: [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone;date.timezone = Americas/Los_Angeles; Did you remove the comment (semicolon)? Also, enclose in quotes and Americas should be America. It should look something like: Code: [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = "America/Los_Angeles"
Dave
|
|
 |
|
 |
|
gymmic
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Sat Jun 02, 2012 7:39 pm |
|
Joined: Wed May 02, 2012 9:27 pm Posts: 5
|
Dave, Thank you for your response. I can confirm that I had the syntax incorrect, however, I am still getting the error. Here is my set up. Mac Running OS X Lion 10.7.4 Using the built in apache, and php. I am making the changes to the php.ini.default located in /private/etc/php.ini.default from my understanding this is where the localhost server keeps the php.ini file. once I make the change I run terminal and type in sudo /usr/sbin/apachectl restart I got to http://localhost/phreedom/index.php with my browser. Attachment:
File comment: log in page
Screen Shot 2012-06-02 at 6.31.37 PM.png [ 34.66 KiB | Viewed 430 times ]
page one. no error. which is progress, I was getting an error there before. I log in, and then get a new page with multiple php warnings. Attachment:
File comment: after submit
Screen Shot 2012-06-02 at 6.31.58 PM.png [ 149.26 KiB | Viewed 430 times ]
I have to reload in order to get to the main ERP page. Am i adjusting the right php.ini file? Should I try this on an actual server? I am not sure it should matter right? Thanks, George
|
|
 |
|
 |
|
dave
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Mon Jun 11, 2012 5:31 pm |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
|
php.ini.default is the default file that needs to be renamed to php.ini to be loaded. You edited the file that ships with php as an example php.ini file but php loads the file php.ini. Try to copy the file from php.ini.default to php.ini and restart apache.
Dave
|
|
 |
|
 |
|
gymmic
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Thu Jun 21, 2012 2:49 am |
|
Joined: Wed May 02, 2012 9:27 pm Posts: 5
|
|
you were correct. Thank you!
|
|
 |
|
 |
|
VisceralConcepts
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Mon Apr 08, 2013 10:49 pm |
|
Joined: Thu Dec 06, 2012 8:03 pm Posts: 4
|
|
I'm having the same issue, but I don't have access to the PHP.ini file. How else can I fix this?
|
|
 |
|
 |
|
alvin
|
Post subject: Re: PHP Warning : date() [function.date] Posted: Wed Apr 10, 2013 6:36 am |
|
Joined: Wed Nov 21, 2007 10:30 am Posts: 569
|
Change hosts, I guarantee this one www.zoomwireless.net If you need help send me a message.
_________________ Alvin
|
|
 |
|
 |
|