Announcement

  •  » Engine
  •  » Message for developers about PHP 5.3

#1 2010-09-12 10:09:21

grum
Former Piwigo Team
Pantin
2007-09-10
1371

Message for developers about PHP 5.3

I've updated PHP engine on my server to PHP 5.3, and I have many warnings...

First, warnings on the regex functions : regex function are deprecated, and we are invited to uses pcre functions instead.
http://docs.php.net/manual/en/intro.regex.php

Second, warnings on the dates functions : I have many messages like this
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 'Europe/Berlin' for 'CEST/2.0/DST' instead


With PHP 5.2, there is no warnings.
I invite you to read the PHP migration 5.2 to 5.3 here => http://docs.php.net/migration53

Note : we have to made Piwigo & plugin compatible with PHP 5.3 and keep compatibilty with 5.2 (or 5.1 ...)

Last edited by grum (2010-09-12 10:10:42)


My pictures with Piwigo, of course !
[ www.grum.fr ]

Offline

 

#2 2010-09-12 10:13:24

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13795

Re: Message for developers about PHP 5.3

Hi grum,

Concerning the timezone settings, I also encountered this problem when upgrading from PHP 5.2 to PHP 5.3: it was due to a missing parameter on configuration file upgrade. If I install PHP 5.3 from scratch, I don't have this error.

Concerning other warnings, are they in Piwigo core or in plugins? (because many PHP 5.3 warnings were fixed on Piwigo and I don't see any of them nowadays)

Offline

 

#3 2010-09-12 10:14:29

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13795

Re: Message for developers about PHP 5.3

grum wrote:

Note : we have to made Piwigo & plugin compatible with PHP 5.3 and keep compatibilty with 5.2 (or 5.1 ...)

Please, don't edit a post to add content, you never know when someone will read your post and you don't receive notifications on post edits :-)

Offline

 

#4 2010-09-12 11:02:04

grum
Former Piwigo Team
Pantin
2007-09-10
1371

Re: Message for developers about PHP 5.3

plg wrote:

Hi grum,

Concerning the timezone settings, I also encountered this problem when upgrading from PHP 5.2 to PHP 5.3: it was due to a missing parameter on configuration file upgrade. If I install PHP 5.3 from scratch, I don't have this error.

Concerning other warnings, are they in Piwigo core or in plugins? (because many PHP 5.3 warnings were fixed on Piwigo and I don't see any of them nowadays)

Ok, I will update the PHP conf file, but may be it could be a good thing to add a functionnality allowing the admin to choose the timezone ;-) Think about french users hosted in US, or US users hosted in France... :-)

For the other warnings, I saw it on one of my plugin, but I think if it's possible to do a grep on subversion (piwigo's core and plugins) to find deprecated function can be a good thing.
Deprecated functions are listed here : http://docs.php.net/manual/en/migration … ecated.php


plg wrote:

Please, don't edit a post to add content, you never know when someone will read your post and you don't receive notifications on post edits :-)

I did it because I've updated my message in the 20seconds after posting the message !! ^^;


My pictures with Piwigo, of course !
[ www.grum.fr ]

Offline

 

#5 2011-06-12 15:35:41

spotter
Member
2011-06-12
1

Re: Message for developers about PHP 5.3

Hello,

I am running Piwigo 2.2.3, PHP 5.3.6, Apache 2.2.19, on Windows XP SP3 (just for testing). I've also run into the error related to TZ:

(from configuration.php)

Warning: main(): 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 '-4.0/DST' instead in C:\Apache2\htdocs\piwigo\admin\configuration.php on line 243 Notice: Undefined index: day in C:\Apache2\htdocs\piwigo\admin\configuration.php on line 243 Warning: main(): 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 '-4.0/DST' instead in C:\Apache2\htdocs\piwigo\admin\configuration.php on line 244 Notice: Undefined index: day in C:\Apache2\htdocs\piwigo\admin\configuration.php on line 244

Piwgo is not picking up the date.timezone setting in php.ini, or is not using it everywhere it should. The TZ error popped up on numerous pages.

I resolved this error by adding:

Code:

date_default_timezone_set('America/New_York');

to include/common.inc.php as line 25. Substitute your own region/city combination.
See http://us.php.net/manual/en/timezones.php


Note: I installed Apache and PHP from scratch. My system already had the Americas/New York setting for JDK, but the php installer didn't pick it up.

Offline

 

#6 2012-01-08 04:58:08

Piwigo otherUser
Guest

Re: Message for developers about PHP 5.3

>>>I resolved this error by adding:

Code:

date_default_timezone_set('America/New_York');
to include/common.inc.php as line 25. Substitute your own region/city combination.
See http://us.php.net/manual/en/timezones.php

I've tried this and still can't get the correct time zone for my gallery. Why can't you add the option for administrators? It is incredibly frustrating for non-PHP jedi masters to have to deal with such a problem.

 

#7 2012-01-08 15:08:07

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13795

Re: Message for developers about PHP 5.3

Piwigo otherUser wrote:

Why can't you add the option for administrators? It is incredibly frustrating for non-PHP jedi masters to have to deal with such a problem.

OK, I'll make some tests to be able to set this setting as a configuration parameter in Piwigo itself.

I've found an old feature request that could match this problem [Bugtracker] ticket 932

Offline

 

#8 2012-01-18 10:42:34

amit
Guest

Re: Message for developers about PHP 5.3

i really thanks to u all about fixing bugs

 
  •  » Engine
  •  » Message for developers about PHP 5.3

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact