Advertisement:

Author Topic: SMF 2.0.11 and php 7  (Read 39055 times)

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,734
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
SMF 2.0.11 and php 7
« on: October 28, 2015, 09:45:20 AM »
Has anyone tested SMF 2.0.11 with php 7?

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,139
Re: SMF 2.0.11 and php 7
« Reply #1 on: October 28, 2015, 09:48:17 AM »
i really doubt it. i bet SMF 2.0 does not work well with it out of the box since it does not come with mysqli support.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,430
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF 2.0.11 and php 7
« Reply #2 on: October 28, 2015, 09:52:48 AM »
it was checked by one person that I know of...   and - as noted, has issues.

It is unlikely that 2.0.x will support php7 any time soon (if ever)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,734
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: SMF 2.0.11 and php 7
« Reply #3 on: October 28, 2015, 10:05:47 AM »
Would the same go for SMF 2.1?

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,139
Re: SMF 2.0.11 and php 7
« Reply #4 on: October 28, 2015, 10:11:00 AM »
SMF 2.1 does support mysqli, but there have not been detailed tests on php 7 to know how much does or does not work.

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: SMF 2.0.11 and php 7
« Reply #5 on: October 28, 2015, 10:18:01 AM »
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

Offline Roph

  • Jr. Member
  • **
  • Posts: 377
  • Gender: Male
Re: SMF 2.0.11 and php 7
« Reply #6 on: December 03, 2015, 07:20:18 PM »
PHP 7.0.0 dropped today, hold off upgrading then? :)

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 21,504
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: SMF 2.0.11 and php 7
« Reply #7 on: December 03, 2015, 07:48:19 PM »
Yes
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

Offline MatrixCrawler

  • Semi-Newbie
  • *
  • Posts: 12
Re: SMF 2.0.11 and php 7
« Reply #8 on: December 08, 2015, 10:18:24 AM »
I just tested it with SMF 2.0.11 and db_type mysqli in settings.php

this is the server-error i get
mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /[...]/Sources/Subs-Db-mysql.php:58, referer: https://www.mydomain.de/index.php [nofollow]

mysql_connect was deprecated in php5.5 and removed in php7 (see http://php.net/manual/en/function.mysql-connect.php [nofollow])

So no PHP7 Support in SMF 2.0.x

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,139
Re: SMF 2.0.11 and php 7
« Reply #9 on: December 08, 2015, 10:23:49 AM »

Offline MatrixCrawler

  • Semi-Newbie
  • *
  • Posts: 12
Re: SMF 2.0.11 and php 7
« Reply #10 on: December 08, 2015, 11:24:54 AM »
God dammit i should read thoroughly and drink more coffee in the afternoon.

nevermind.

Offline Steve

  • Freak
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,499
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: SMF 2.0.11 and php 7
« Reply #11 on: December 08, 2015, 05:33:48 PM »
Easy on the language please. It's a family friendly place here. ;) :)
Online Manual

Please do not PM me for support.

Offline CaptainKirk

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
Re: SMF 2.0.11 and php 7
« Reply #12 on: December 16, 2015, 10:39:21 AM »

Actually, no it doesn't help at all because of the differences in mysql and mysqli calling formats as well as specific references to mysql throughout.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,430
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF 2.0.11 and php 7
« Reply #13 on: December 16, 2015, 11:28:21 AM »
did you APPLY the mod?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline AndrzejL

  • Semi-Newbie
  • *
  • Posts: 27
Re: SMF 2.0.11 and php 7
« Reply #14 on: January 02, 2016, 03:01:10 PM »
Arch Linux added php 7.0 as a default php in their repos today. I bit the bullet. Part of the services went down. Piwigo / SMF (with the error mentioned above) and few others.

Downgraded to previous version of the php-* packages, added php-* to the ignorepkg list for now. Installed the mysqli mod and changed Settings.php as mentioned above, restarted the mysqld, php-fpm and nginx. Everything is back up. At least next time I will upgrade the php-* packages I will be able to test the mysqli mod at work.

Cheers.

Andrzej

Offline Antes

  • Evil Black Cat
  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,943
  • Gender: Male
  • Black cat rulz!
    • Antes on GitHub
    • merta on LinkedIn
    • @XinYenFon on Twitter
    • WoWSnips
Re: SMF 2.0.11 and php 7
« Reply #15 on: January 02, 2016, 06:57:58 PM »
Mods can be incompatible with PHP7 but after adding MySQLi mod core forum working pretty well.
You can support me directly via Patreon

In Catnip We Trust.
The solution is Catnip!
Vote for Catnip!

Current Project(s): [ WoWSnips ]
Past Project(s): [ ezPortal ] # [ Lunarfall ] # [ RDD (HTML5) ]

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF 2.0.11 and php 7
« Reply #16 on: January 19, 2016, 01:30:40 AM »
SMF should really be upgraded to use PDO, or at least MySQLi. The old MySQL extension has been deprecated for many many years now... MySQLi was released in 2004 and PDO was released in 2005. There's no reason to continue using the old extension. The entire database abstraction layer in SMF should probably be replaced with PDO at some point.

For now I'm running both PHP 5 and PHP 7 on my server. I've moved most sites over to PHP 7, but legacy software such as SMF is currently still on PHP 5.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,430
  • Gender: Male
    • Kindred-999 on GitHub
Re: SMF 2.0.11 and php 7
« Reply #17 on: January 19, 2016, 07:43:31 AM »
smf 2.1 will work just fine with php7 and mySQLi commands
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,524
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: SMF 2.0.11 and php 7
« Reply #18 on: January 19, 2016, 10:08:26 AM »
SMF should really be upgraded to use PDO, or at least MySQLi. The old MySQL extension has been deprecated for many many years now... MySQLi was released in 2004 and PDO was released in 2005. There's no reason to continue using the old extension. The entire database abstraction layer in SMF should probably be replaced with PDO at some point.

For now I'm running both PHP 5 and PHP 7 on my server. I've moved most sites over to PHP 7, but legacy software such as SMF is currently still on PHP 5.

I'm glad that you are already running php7, however please do note that not everyone (and by everyone I mean Linux distros and big hosting companies) is a fan of running the shiniest php versions out there (even if they are already marked as stable) come on! you should know this.

Making SMF 2.0.x compatible with PHP7 isn't as easy as you think it is, we still support pretty old PHP versions (and yes, people STILL use PHP 4). We just can't happily jump into the php7 wagon without making sure everyone will still be able to use SMF on whatever server configurations we told them SMF can work on.

SMF 2.1 is already using mysqli and it will be compatible with PHP7  the reason behind not going with PDO is simple, compatibility with SMF 2.0.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: SMF 2.0.11 and php 7
« Reply #19 on: January 19, 2016, 06:16:05 PM »
Quote
and yes, people STILL use PHP 4
Is it worth keeping the legacy code  just for the very very few people that use PHP 4 though? I used to be on the customization team and work on the SMF code a lot (around the days of SMF 1.0 and 1.1 Beta) and there's a huge amount of technical debt in the older SMF code. It's baggage that doesn't belong in a modern application. PHP 4 is long gone now. In fact anything older than PHP 5.5 is not even supported by the PHP project any more. At some point you need to let go of the past and move on :)

Quote
please do note that not everyone (and by everyone I mean Linux distros and big hosting companies) is a fan of running the shiniest php versions out there

Lots of people are upgrading to PHP 7, almost all major frameworks and quite a few major applications run out-of-the-box. All of the things that were removed in PHP 7 have been obsolete/deprecated for many years now, and any code that has been actively maintained during that time runs fine on PHP 7 with no modifications. None of it should be a surprise :) Examples include the POSIX regex functions (ereg) which have been deprecated since PHP 5.3 (2009), and the old MySQL extension which has been deprecated since the release of MySQLi with MySQL 4.1 (2004) and PDO (2005). People aren't going to hold off upgrading just because SMF doesn't support it, especially when all other software on their server runs on PHP 7 with no issues.

Back in the SMF 1.0 era it made sense to use PHP 4 compatible code, but today I doubt you'll find anyone in the wild still running PHP 4.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!