News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF 1.1.x incompatibility with recent PHP versions (PHP5.5+)

Started by margarett, March 20, 2015, 09:19:38 PM

Previous topic - Next topic

margarett

SMF 1.1 final was released in late 2006, which makes it a 8+ years old product.

While the foundations of the codebase remain very fast, stable and secure even by today's standards, the evolution of the technologies on which it is based (especially PHP and MySQL) has reached a point where it is no longer viable to fix incompatibilities.

Starting from PHP 5.5 and MySQL 5.6, your existing SMF 1.1.x setup will no longer function properly. Immediate symptoms are:
* Warnings (thousands in a short amount of time) in your error log, about a PHP deprecated function
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ...................
* Wrong boards order in your Board Index

You should note that PHP has already reached version 5.6+ and the current version of MySQL is 5.7+, so it is very likely that your host will upgrade to more recent versions shortly.
If you still run SMF 1.1.x you should consider an upgrade to 2.0.x, with time to try to adapt things while everything still works, instead of trying to recover from an unusable forum if the current incompatibilities get worse with time. The chances are that further changes to PHP/MySQL will render 1.1.x unusable in a not so distant future.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Biology Forums

Many of us are waiting for SMF 2.1. Until then, any work done on 2.0.x is futile in my opinion.

vbgamer45

1.1.x will work fine on  php 5.5
Here is a quick change to fix all notices.

open index.php change

error_reporting(E_ALL);

To

error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);


open ssi.php
Change

$ssi_error_reporting = error_reporting(E_ALL);

To

$ssi_error_reporting = error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);


Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Illori

that just hides the problem, it does not actually fix the issue.

Kindred

and the reason you get the deprecated warning is because the function will soon be completely removed instead of just deprecated
- so, hiding the warning will get you a short time of function - all the while you are digging yourself deeper into a hole when you will eventually HAVE to upgrade in a short time instead of a planned migration.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

vbgamer45

I understand. It still works which I am going to use for my sites I rather be on the new php version then on an old php version for now.
Was forced today since openssl needed to be updated for paypal.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Biology Forums

Quote from: vbgamer45 on March 17, 2016, 03:02:16 PM
I understand. It still works which I am going to use for my sites I rather be on the new php version then on an old php version for now.
Was forced today since openssl needed to be updated for paypal.

What do you mean, PayPal requires version 5.5?

vbgamer45

For the new updates they are doing requires latest openssl to support the right SSL connection types. They are doing a lot of updates that take affect june this year I been getting their emails.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Biology Forums

Quote from: vbgamer45 on March 17, 2016, 04:40:37 PM
For the new updates they are doing requires latest openssl to support the right SSL connection types. They are doing a lot of updates that take affect june this year I been getting their emails.

Thanks for the info. On a side note, I still can't believe they haven't been overtaken by their competitors (really, really hate PayPal).

JBlaze

Quote from: Shuban on March 17, 2016, 04:47:09 PM
Thanks for the info. On a side note, I still can't believe they haven't been overtaken by their competitors (really, really hate PayPal).

I agree, but PayPal will be around for the foreseeable future. But I much prefer Amazon Payments over PayPal.
Jason Clemons
Former Team Member 2009 - 2012

Biology Forums

I remember looking into Amazon payment, only problem was they weren't available globally - only for US residents.

JBlaze

Quote from: Shuban on March 17, 2016, 04:55:41 PM
I remember looking into Amazon payment, only problem was they weren't available globally - only for US residents.
I could be wrong, but I do believe they have expanded into other countries.
Jason Clemons
Former Team Member 2009 - 2012

Biology Forums

Quote from: JBlaze on March 17, 2016, 05:00:57 PM
Quote from: Shuban on March 17, 2016, 04:55:41 PM
I remember looking into Amazon payment, only problem was they weren't available globally - only for US residents.
I could be wrong, but I do believe they have expanded into other countries.

True, but not Canada: Checkout by Amazon is currently available to sellers in the United States, the United Kingdom, Germany, and Luxembourg.

vbgamer45

One other change to make
In index.php
Find

set_error_handler('error_handler');

Change to

set_error_handler('error_handler',E_ALL & ~E_DEPRECATED & ~E_NOTICE);
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Veric

I just registered to say thank you!
I have an older forum that has been left running for a number of years with a small membership, so never really seen the need to upgrade as it just 'works'.

The recent PHP change by my host threw me in the deep end, but now it's back up and running for now.
I now know I have no choice but to look at upgrading it, which is a shame as I like my forum's layout, mods, customization etc:

At least your fix has bought me some time to investigate just how to upgrade 1.1.21 to latest.
I'm just disappointed that I need to upgrade, site's been up for close to 10 years and only now has it 'broken'.

Many thanks for you help.

Also to anyone needing to upgrade to 1.1.21 from an older version, if your admin control panel does not let you upgrade the normal way:

1) Click the normal upgrade link, when you get the errors look at the address bar and you'll see the URL for the .zip file for the 1.1.20/1.1.21 file.
2) Browse to this manually and download the file.
3) You can then manually go to package manager, upload the .zip and apply it without getting the error messages stopping you. Note you may need to rename the zip with something on the end if it says the file already exists. For example I renamed mine from 'smf_patch_1.1.21_2.0.10' to 'smf_patch_1.1.21_2.0.10-2' to then upload and apply it.

Quote from: vbgamer45 on March 26, 2016, 09:42:01 PM
One other change to make
In index.php
Find

set_error_handler('error_handler');

Change to

set_error_handler('error_handler',E_ALL & ~E_DEPRECATED & ~E_NOTICE);


HostDash

Quote from: Veric on May 09, 2016, 04:47:48 AM
I just registered to say thank you!
I have an older forum that has been left running for a number of years with a small membership, so never really seen the need to upgrade as it just 'works'.

The recent PHP change by my host threw me in the deep end, but now it's back up and running for now.
I now know I have no choice but to look at upgrading it, which is a shame as I like my forum's layout, mods, customization etc:

At least your fix has bought me some time to investigate just how to upgrade 1.1.21 to latest.
I'm just disappointed that I need to upgrade, site's been up for close to 10 years and only now has it 'broken'.

Many thanks for you help.

Also to anyone needing to upgrade to 1.1.21 from an older version, if your admin control panel does not let you upgrade the normal way:

1) Click the normal upgrade link, when you get the errors look at the address bar and you'll see the URL for the .zip file for the 1.1.20/1.1.21 file.
2) Browse to this manually and download the file.
3) You can then manually go to package manager, upload the .zip and apply it without getting the error messages stopping you. Note you may need to rename the zip with something on the end if it says the file already exists. For example I renamed mine from 'smf_patch_1.1.21_2.0.10' to 'smf_patch_1.1.21_2.0.10-2' to then upload and apply it.

Who is your hosting provider and what control panel are they providing you? Most providers in the shared market should offer you the ability of selecting your own PHP version (Including PHP 5.2, 5.3, 5.4 etc) . You should see something like a 'Select PHP Version' icon in your control panel if your web host offers it.

Whilst it is recommended you stay up to date, this might be an option worth considering.

knagl

Quote from: Alex - A2Hosting on May 11, 2016, 05:19:33 PM
Who is your hosting provider and what control panel are they providing you? Most providers in the shared market should offer you the ability of selecting your own PHP version (Including PHP 5.2, 5.3, 5.4 etc) . You should see something like a 'Select PHP Version' icon in your control panel if your web host offers it.

Whilst it is recommended you stay up to date, this might be an option worth considering.

Hey, thanks for posting this.  My webhost gives me the cPanel interface, and sure enough there was that option in there.  It looks like they recently upgraded to 5.6, but with that option in the control panel I was able to downgrade back to 5.4.  Obviously I know I need to bite the bullet and start figuring out how to upgrade to SMF 2.x, but at least my forum is back to normal functionality for a while so I can upgrade at my convenience, rather than having to do it tonight.

equinoxmatt


Kindred

only barely - there will, however, be no further releases of the 1.1.x branch
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

naro

I have extracted fixes for preg_replace(_callback) from SMF 2.0.15 into a XML mod file which I use together with my own mod for 1.1.21.
If you have your own modifications, you can add this XML file and apply it or you can create new mod with that modifications.

Please note, I'm using Queryless URLs without Apache 1.0 mod in 1.1.21 and also some other custom modifications and I'm not sure if it affects the pregreplace.xml modifications or not.

No warranty! I can't confirm everything would work in all situations. I'm also not sure if the mod covers all places where preg_replace with 'e' modifier is used. I'm using this mod with PHP 5.6 for few weeks and we did not notice any problems so far but our users could not use all features.




Advertisement: