Strict Standards - PHP 5.2 vs PHP 5.5

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

Strict Standards - PHP 5.2 vs PHP 5.5

Postby Jost aus Soest » Thu Sep 18, 2014 9:41 pm

After updating to PHP 5.5 I'm getting many error messages like that:
Strict Standards: getdate(): 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 in .../htdocs/pivotx/pivotx/lib.php on line 4760


I'm using pivotx 2.3.10 with flat files.

Examples:
PHP 5.5: http://www.soester-kumpaney.de/ - ERR
PHP 5.2: http://www.firlitanz.de/ - OK

Both websites are generated from the same db with same templates (apart the header).

I've already tried the suggested workarounds (using the date.timezone setting or the date_default_timezone_set-function) without success.

How can I solve this problem?

BTW, the phpinfos:
http://www.soester-kumpaney.de/pivotx/phpinfo.php
http://www.firlitanz.de/pivotx/phpinfo.php
Last edited by Jost aus Soest on Fri Sep 19, 2014 9:09 am, edited 1 time in total.
Jost aus Soest
 
Posts: 21
Joined: Fri Sep 14, 2012 8:00 am
Location: Soest (Germany)

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby hansfn » Thu Sep 18, 2014 10:42 pm

I've already tried the suggested workarounds (using the date.timezone setting [...]


What did you set it to and in what file? If you did it correctly, it should work.

You probably also could just suppress the "Strict Standards" warnings. What is you error_reporting level in php.ini? Replacing

Code: Select all
error_reporting = E_ALL

with

Code: Select all
error_reporting = E_ALL & ~E_STRICT

Read more about this at for example http://stackoverflow.com/questions/9983286/
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby Jost aus Soest » Fri Sep 19, 2014 8:26 am

Thanx a lot for your fast response!

I've created an php.ini file in the pivtox-folder (where are already files like lib.php, scheduler.php, ...) with this content:
Code: Select all
date.timezone = Europe/Berlin
display_errors = Off
error_reporting = E_ALL & ~E_STRICT


Also I've included this line into pivotx/index.php (just before the initializePivotX-call):
Code: Select all
date_default_timezone_set('Europe/Berlin');
Jost aus Soest
 
Posts: 21
Joined: Fri Sep 14, 2012 8:00 am
Location: Soest (Germany)

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby Jost aus Soest » Fri Sep 19, 2014 8:49 am

OK, I've created an php.ini file above the pivtox-folder with this content:
Code: Select all
date.timezone = Europe/Berlin


This seems to solve all the problems! :o)
Jost aus Soest
 
Posts: 21
Joined: Fri Sep 14, 2012 8:00 am
Location: Soest (Germany)

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby Jost aus Soest » Fri Sep 19, 2014 9:08 am

Not all problems are solved... :o(

At the right side of my website are still some error messages like this:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in .../htdocs/pivotx/pivotx/lib.php on line 4745

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in .../htdocs/pivotx/pivotx/includes/textile/classtextile.php on line 1011


Any hints?
Jost aus Soest
 
Posts: 21
Joined: Fri Sep 14, 2012 8:00 am
Location: Soest (Germany)

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby hansfn » Fri Sep 19, 2014 8:22 pm

OK, I've created an php.ini file above the pivtox-folder

Glad you discovered yourself that php.ini has to be in the root folder.

To avoid the deprecated warnings, add

Code: Select all
error_reporting = E_ALL ^ E_DEPRECATED

to the php.ini file
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby Jost aus Soest » Fri Sep 19, 2014 10:02 pm

OK, suppressing warnings is a workaround...

BUT:
"Deprecated" means, that in the future the code will not working...
Jost aus Soest
 
Posts: 21
Joined: Fri Sep 14, 2012 8:00 am
Location: Soest (Germany)

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby hansfn » Sat Sep 20, 2014 7:34 am

I guess I should have explained why I asked you to hide the warnings in stead of fixing the code:

PivotX is a "dead" project - only security bugs will be fixed. New users should try out Bolt (which is created by the people behind PivotX) or maybe WordPress.

PS! PivotX can be kicked alive if so new developers find interest in the project.
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby Jost aus Soest » Sat Sep 20, 2014 8:05 am

I understand. :shock:
That's a pity. :(
So, as I can use only flat files I'm lost... :?:

What would you recommend me to do in the (near?) future?
A solution where I can easily transform my existing pivotx-projects (kind of "auto import")?
A solution where I must not use SQL-DBMSs?

BTW, only with this line in php.ini I was able to stop the deprecated messages:
Code: Select all
display_errors = Off
Jost aus Soest
 
Posts: 21
Joined: Fri Sep 14, 2012 8:00 am
Location: Soest (Germany)

Re: Strict Standards - PHP 5.2 vs PHP 5.5

Postby hansfn » Sat Sep 20, 2014 1:01 pm

Let's see if I can answer some of this:

  1. If PivotX serves your needs, you can probably use it for 2-3 more years without other problems than what you have already experienced.
  2. Bolt supports SQLite, a single file database (no server needed), which is included in all recent versions of PHP. In other words, no need for MySQL in your hosting plan if you switch to Bolt.
  3. There is an incomplete upgrade path from PivotX to Bolt. (It uses the RSS feed so you get all that is included in the feed, but nothing more.) I hope to get time to complete it this fall.
  4. You should always turn off display_errors on a site that is in production. The reason, my change to error_reporting didn't work is that PivotX is over-writing the change at the end of modules/module_debug.php: Replacing

    Code: Select all
    error_reporting( E_ALL ^ E_NOTICE ^ E_WARNING );

    with

    Code: Select all
    error_reporting( E_ALL ^ E_NOTICE ^ E_WARNING ^E_DEPRECATED);

    in that file should work (even with display_errors on).
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Next

Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 3 guests

cron