arrow_upward

Pages (2):
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beware! PHP 8 may break old WP Themes!
#1
So the last week I had a project which meant I had to move some of my WordPress sites from one VPS to another. There were five Websites involved and the move should have taken me an hour or a little more to do. Except, it took up to a few days instead trying to troubleshoot a broken database.

A major hurdle turned out to be one of my oldest WordPress sites. When I move a WP site I use the All In One WP Migration Plugin to create backups after every change. So usually it's quick and easy. I create a new WP installation at the destination site. Then import the backup. With the old Website it is the first time ever that my backup had a critical issue with the database. Thing is this only happened with this very old WordPress site. The other sites that had old WP themes were OK, but the site that had the critical database issue was a very old theme called Tetris.

Took quite a while for me to figure out that the reason was php 8.0. I then picked up on a warning by WordPress to be careful not to use php 8.0 as there seems to be conflicts with some of the themes and plugins. They are investigating this.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#2
And it breaks applications too.I installed PHP 8.0 on my vps and when I wanted to install SMF 2.1.8 it breaks installation by numerous warnings.So I have to install another version of PHP for it.

It seems some expressions are no longer supported that might cause the themes stopped to work - as I noticed that array indexs described by {} is no longer supported and throws error while in PHP 7.3(at my local testing) it does not throw an error at least.

Well,unless the theme and application explicitly says support for PHP 8.x otherwise 7.3 is still fine.

---Offtopic:
Actually a little more annoying thing for me is the application uses apache(.htaccess for link shortening) but your server is nginx when you dont know how to properly conf it.
VPS 3 Provided by Post4vps and Racknerd .
#3
I believe it has to do with how Wordpress constructs themes and plugins and with PHP 8 there are significant improvements in the constructor function that makes it so you don’t have to implement a bunch of “boilerplate” code to begin initializing properties.

There were some hefty hiccups with the upgrade from PHP 6 to 7 and Wordpress and how the script package interacted with .htaccess and some of the other url rewriting components.
Thank you to CubeData and Posts4VPS for the services of VPS 8.
#4
(05-08-2021, 03:04 AM)tbelldesignco Wrote: There were some hefty hiccups with the upgrade from PHP 6 to 7 and Wordpress and how the script package interacted with .htaccess and some of the other url rewriting components.
You mean PHP 5 to 7!.. PHP-6 did never make it :-)

And, indeed, and that should not come as a surprise to any web developer really!... Upgrading from one major PHP version to another has historically broke a lot of websites, PHP-based CMS etc... This one should not be any exception and a code-base audit must be a routine practice for every project out there.
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#5
(05-08-2021, 03:24 AM)fChk Wrote: You mean PHP 5 to 7!.. PHP-6 did never make it :-)

And, indeed, and that should not come as a surprise to any web developer really!... Upgrading from one major PHP version to another has historically broke a lot of websites, PHP-based CMS etc... This one should not be any exception and a code-base audit must be a routine practice for every project out there.

You’re right! That was a typo on my part! PHP 6 was a fail experiment with the greatest coverup story I’ve ever seen.
Thank you to CubeData and Posts4VPS for the services of VPS 8.
#6
I have seen some projects were abandoned during the pHp 7 upgrade. The major thing was it removed mysql_real_escape_string. It was required as sql injection was at its peak. Those who upgraded their source code has not lost in the game. Coming to PHP 8 I see the rules are more strict, mcrypt has deprecated. Also even the variable code required to be in proper syntax. I mean in php7 it was accepted that we can print variable like $result[id] but in php 8 we must use $result['id']. Even such small things are being concentrated to ensure the code is in a good manner. I see the upgrades are for the best rather than a burden. It gives much better experience if we can upgrade the projects.


Thank you  Sweet



#7
(05-08-2021, 05:25 AM)Littlemaster Wrote: I have seen some projects were abandoned during the pHp 7 upgrade. The major thing was it removed mysql_real_escape_string. It was required as sql injection was at its peak. Those who upgraded their source code has not lost in the game. Coming to PHP 8 I see the rules are more strict, mcrypt has deprecated. Also even the variable code required to be in proper syntax. I mean in php7 it was accepted that we can print variable like $result[id] but in php 8 we must use $result['id']. Even such small things are being concentrated to ensure the code is in a good manner. I see the upgrades are for the best rather than a burden. It gives much better experience if we can upgrade the projects.

What was interesting to me is that I was transferring four WP sites from one VPS to another.  Three had no issues, and they had default twenty thirteen WP themes on it that I updated with a child theme.  So looks like Wordpress themes are OK.  

For me looks like old themes that owners of the themes are no longer interested in, and have forgotten about, but are still popular any way, are going to be a real problem.  I have a few other Website backups that I "archived" a while ago, that are basically extinct now.  

(05-08-2021, 03:00 AM)mzltest Wrote: And it breaks applications too.I installed PHP 8.0 on my vps and when I wanted to install SMF 2.1 it breaks installation by numerous warnings.So I have to install another version of PHP for it.

It seems some expressions are no longer supported that might cause the themes stopped to work - as I noticed that array indexs described by {} is no longer supported and throws error while in PHP 7.3(at my local testing) it does not throw an error at least.

Well,unless the theme and application explicitly says support for PHP 8.x otherwise 7.3 is still fine.

Thanks for the feedback @mzltest.  I've got a few  hosting accounts, including shared hosting accounts.  There is one I value very much for always being up to date - Limitless Hosting - and not only does it have php 7.3 as the recommended php, but there are several versions to choose from in its panel.  Coincidentally, last night when I created a new Website with CyberPanel (a user account with @fitkoh) running on his VPSs from RackNerd, when you create the Website it gives you a selection of VPS 7 versions to choose from. Courtesy of CyberPanel.
(05-08-2021, 03:00 AM)mzltest Wrote: ---Offtopic:
Actually a little more annoying thing for me is the application uses apache(.htaccess for link shortening) but your server is nginx when you dont know how to properly conf it.
Aha.  Now that must be the reason for the problem in the first instance.  Nginx.  And yes, there were a Tower of Babel number of suggestions out there how to conf it.  I tried, but obviously was doing it in the dark - I didn't really know or understand what I was doing.  There was the var/www/httpd .htaccess suggestions and then the public folder .htaccess.  In the end I thought I may create a security issue when I didn't know exactly what the consequences were going to be. As Admin at Gigarocket we always discouraged members from using .htaccess as it's not that secure to Override "All" functions. Silver lining is that I connected up with my CyberPanel Account, and am studying it presently for installing on my VPS 9.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#8
(05-08-2021, 12:54 PM)deanhills Wrote: What was interesting to me is that I was transferring four WP sites from one VPS to another.  Three had no issues, and they had default twenty thirteen WP themes on it that I updated with a child theme.  So looks like Wordpress themes are OK.  

For me looks like old themes that owners of the themes are no longer interested in, and have forgotten about, but are still popular any way, are going to be a real problem.  I have a few other Website backups that I "archived" a while ago, that are basically extinct now.  
Yes.But in many cases you don't have to make a dedicated support for newer versions as long as in your versions there is no DEPRACATED or NOTICE warnings. And maybe that's why some applications in PHP 5.6 era works with PHP 7.x .As for me since I made a simple pastebin myself that I once mentioned in shoutbox,my local environment is PHP 7.3 while the website environment is PHP 8.0.Most of the code works except that one function I used from internet which used to generate a fixed number of random characters,which I mentioned last reply.
Quote:Thanks for the feedback @mzltest.  I've got a few  hosting accounts, including shared hosting accounts.  There is one I value very much for always being up to date - Limitless Hosting - and not only does it have php 7.3 as the recommended php, but there are several versions to choose from in its panel.  Coincidentally, last night when I created a new Website with CyberPanel (a user account with @fitkoh) running on his VPSs from RackNerd, when you create the Website it gives you a selection of VPS 7 versions to choose from.  Courtesy of CyberPanel.
Yeah.Most hosting provide PHP versions from 5.6 to 7.4.As this is a new-stage release rather than maintaince the applications aren't ready for it and there are many uncompatibilities.And for this reason I believe the PHP 5.6 is provided for these old and maybe unmaintained scripts to work.

(Offtopic)
Quote:Aha.  Now that must be the reason for the problem in the first instance.  Nginx.  And yes, there were a Tower of Babel number of suggestions out there how to conf it.  I tried, but obviously was doing it in the dark - I didn't really know or understand what I was doing.  There was the var/www/httpd .htaccess suggestions and then the public folder .htaccess.  In the end I thought I may create a security issue when I didn't know exactly what the consequences were going to be. As Admin at Gigarocket we always discouraged members from using .htaccess as it's not that secure to Override "All" functions.  Silver lining is that I connected up with my CyberPanel Account, and am studying it presently for installing on my VPS 9.
Peraonally I think most applications prefer apache than nginx as they can modify the server settings in their working directory to fit the needs by themselves just using .htaccess however in nginx you need to ask the user to modify nginx.conf .
VPS 3 Provided by Post4vps and Racknerd .
#9
Yesterday i got same issue. after installing PHP 8.0 fopen error got.
i am stuck in a error which never heal.
also unable to uninstall or downgrade php.
Heart LOVE FOR ALL  HATRED FOR NONE Heart
#10
Thanks for the feedback @sagher.  Funny side of it however is when my old theme became extinct  I spent an hour or more searching for a new theme and found one that was much nicer, modern, more efficient and really motivated me to overhaul the Website.  Next thing I knew I was rearranging pages, adding new content and am now much happier with my Website than I had been before.  So this sad story had a good ending.  It motivated me to improve my efforts.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
Pages (2):


person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting