PHP 7

Questions about how to install and problems installing - please read the documentation first!
Post Reply
Tata
Posts: 3626
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

PHP 7

Post by Tata » Sat Mar 19, 2016 6:59 am

I have tried to change the PHP version in my webspace from v5.5 to v 7 and loading a webpage I got the warning:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; XH_CSRFProtection has a deprecated constructor in /www/c/m/u13296/public_html/_sub/funnytree/cmsimple/classes/CSRFProtection.php on line 28...

So I went back to v 5.6. Shouldn't it be revised on older webpages and change thing with some patches?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14227
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: PHP 7

Post by cmb » Sat Mar 19, 2016 8:54 am

Tata wrote:Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; XH_CSRFProtection has a deprecated constructor
The message does not currently point at an error in the code, but rather points out that there will be a problem in a future version, which is most likely to be PHP 8. There is plenty of time until PHP 8 will be released, so we have plenty of time to fix the issue.

While it would be possible to fix the deprecation notice and let the code still work for PHP 4, I don't think it makes sense to do so. Instead I still prefer to drop support for PHP 4 altogether in the next version of CMSimple_XH (i.e. 1.7)[1], where this issue will be resolved in a clean way.

Anyhow, there's no real problem to use CMSimple_XH 1.6.7 with PHP 7.0.x, and most likely not with 7.1.x.

[1] Well, actually I would prefer that we had dropped PHP 4 support long ago.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3626
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: PHP 7

Post by Tata » Sat Mar 19, 2016 9:06 am

Fine. So I probably update my webspace for a use of PHP7?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14227
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: PHP 7

Post by cmb » Sat Mar 19, 2016 10:28 am

Tata wrote:Fine. So I probably update my webspace for a use of PHP7?
If there are no problems with any plugins you are using or are planning to use, I suggest you do so. For instance, PHP 7 removed the regex extension by default, and a lot of old plugins use ereg*(), what would break the site.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3626
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: PHP 7

Post by Tata » Sat Mar 19, 2016 6:57 pm

Well, so far no problems. But I haven't checked all websites running in my webspace. I will test them this week, hopefully.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3626
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: PHP 7

Post by Tata » Sat Mar 19, 2016 8:04 pm

Well, but after upgrading to PHP v7, the warbing
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; XH_CSRFProtection has a deprecated constructor in /www/c/m/u13296/public_html/_sub/funnytree/cmsimple/classes/CSRFProtection.php on line 28...
is back.
Where and how shall I switch the warning OFF? It would be nice to have some PHP script to be able to hide the warnings in "visitor" mode and keep it optional in "edit" mode.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14227
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: PHP 7

Post by cmb » Sun Mar 20, 2016 12:26 pm

Tata wrote:Where and how shall I switch the warning OFF? It would be nice to have some PHP script to be able to hide the warnings in "visitor" mode and keep it optional in "edit" mode.
That is exactly how the debug mode is supposed to work. :?
Christoph M. Becker – Plugins for CMSimple_XH

Michael_G
Posts: 203
Joined: Thu Feb 18, 2016 11:01 pm
Contact:

Re: PHP 7

Post by Michael_G » Sun Mar 20, 2016 10:00 pm

Hi Tata,

set the debug level in the _XHdebug.txt from 6 (?) to 3 to get only messages when a real issue will occur. :mrgreen:
Ciao
Michael

Let's Encrypt!

Post Reply