News:

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

Main Menu

PHP upgrade to 8.1 crashed my site

Started by FragaCampos, August 05, 2024, 01:55:57 PM

Previous topic - Next topic

FragaCampos

Greetings.

Two days ago, my webserver upgraded PHP to version 8.1, which broke my site.
Because of that, they had to revert to PHP 7.4, but that broke my search (for what I've seen so far).
From what I read here, I should recreate my search index, but that didn't solve the problem.

This is what I see when I do a search:


And this is what I have in settings (I created a custom index, to no avail, and I have that message saying I can't create a full index, which was the option I had for years):



What should I do now?

Sir Osis of Liver

2.0.19 supports php 8.0, it will run in 8.1 but log errors.  Anything earlier than 2.0.19 supports up to php 7.4.  If you're running 2.0.19 and forum crashed, it's most likely due to a mod that doesn't work in php 8.x.  You can upload a clean set of 2.0.19 files, that will remove all mods and customizations, and upgrade php to 8.0.  See if that fixes the problem.  Best bet is to upgrade forum to current version 2.1.4.
When in Emor, do as the Snamors.
                              - D. Lister

Aleksi "Lex" Kilpinen

So, could you confirm you are actually on 2.0?
The error makes me think you are not, and are in fact on 1.1. since I think that file belongs to a 1.1 mod.
SMF Search Enhancement Mod

EDIT: I'm stupid, it's stated in your screenshot - you are on 2.0, and therefore you probably have the 2.0 version of this mod that no longer exists for some reason. Anyways, uninstalling this mod would be my first step in solving the issue.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

FragaCampos

Quote from: Aleksi "Lex" Kilpinen on August 05, 2024, 02:17:03 PMSo, could you confirm you are actually on 2.0?
The error makes me think you are not, and are in fact on 1.1. since I think that file belongs to a 1.1 mod.
SMF Search Enhancement Mod

EDIT: I'm stupid, it's stated in your screenshot - you are on 2.0, and therefore you probably have the 2.0 version of this mod that no longer exists for some reason. Anyways, uninstalling this mod would be my first step in solving the issue.

Thanks!
You were right, uninstalling this mod solved the problem.  8)
So, if this mod was the problem, can I ask to upgrade again to 8.1 to see if the problem went away?

Aleksi "Lex" Kilpinen

You can try, but 2.0 does not fully support 8.1 so if you have the option to stay on 8.0 instead, I would recommend that, or upgrading to SMF 2.1
You will be forced to upgrade to 2.1 at some point though, if your host keeps updating PHP like that.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

FragaCampos

The problem with upgrading to 2.1 is my theme...
I know I have to do it some day, but I prefer not to think about it right know  O:)

Kindred

You nedc to think about it sooner rather than later,  since you are going to see more and more incompabilities popping up
Сл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."

FragaCampos

Quote from: Kindred on August 05, 2024, 04:34:44 PMYou nedc to think about it sooner rather than later,  since you are going to see more and more incompabilities popping up

Yah, that's really the main problem.
I guess I really need to start reserving the time to do it...

Anyway, for some reason, my forum doesn't run with PHP 8.0. I tried it via cPanel, but I had to revert back to 7.4.

I found two more problems, probably related to other mods, but that only appeared after this upgrade attempt.
The first one is this, which appears when I click on a main menu button, which points to a static page:


The other one is this, which appears when clicking on another main menu button, a tops page:


Any thoughts? Should I open a topic for each of these issues?

Kindred

Well, how did you add the menu link?

The second error would appear to be related to your post ratings mod
Сл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."

FragaCampos

Quote from: Kindred on August 05, 2024, 08:01:33 PMWell, how did you add the menu link?

I added it in Subs.php, with this code:
'donativos' => array(
                'title' => $txt['donativos'],
                'href' => $scripturl . '?spage=donativos',
                'show' => !$user_info['is_guest'],
                'sub_buttons' => array(
                ),


Quote from: Kindred on August 05, 2024, 08:01:33 PMThe second error would appear to be related to your post ratings mod

This was working without problems before.  :-\
This is the code I have in that area mentioned by the error above. Is there anything I can change?
    // Highest User Ratings Query...
    $userrated_result = $smcFunc['db_query']('', '
        SELECT
            COUNT(mr.id_msg) AS total_votes, m.id_member, IFNULL(mem.real_name, mem.member_name) AS user_name
            FROM {db_prefix}topics AS t
            INNER JOIN {db_prefix}messages AS m ON (m.id_topic = t.id_topic AND m.ratings_enabled = {int:is_one} AND m.rating != {int:is_zero}' . (empty($modSettings['post_ratings_type']) && empty($modSettings['post_ratings_first_post']) ? ' AND m.id_msg != t.id_first_msg' : '') . ')
            INNER JOIN {db_prefix}message_ratings AS mr ON (mr.id_msg = m.id_msg' . $user_days_query . ')
            INNER JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
            WHERE t.is_ratings = {int:is_one} AND t.approved = {int:is_one}' . (empty($modSettings['post_ratings_stats_locked_topics']) ? ' AND t.locked = {int:is_zero}' : '') . '
            GROUP BY m.id_member
            ORDER BY total_votes DESC, mr.date ASC
            LIMIT {int:limit}',
        array(
            'is_one' => 1,
            'is_zero' => 0,
            'limit' => !empty($modSettings['post_ratings_stats_highestusers_limit']) ? (int) $modSettings['post_ratings_stats_highestusers_limit'] : 10,
        )
    );

Kindred

....   ok, and what is the text string that you have defined $txt['donativos'] to be?


Yeah..postratings mod was last updated for 2.0.3.  You can be fairly certain that it does not support modern php or possiubly mySQL versions...   the solution would be to ask in the post ratings mod support thread or uninstall the mod
Сл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."

FragaCampos

Quote from: Kindred on August 06, 2024, 11:11:33 AM....   ok, and what is the text string that you have defined $txt['donativos'] to be?

I have it defined in index.portuguese_pt-utf8.php
$txt['donativos'] = 'Donativos';

So, if the mod was functioning before, it means the forum was in a previous version of PHP 7.4?
Thanks anyway. I'll ask for help on the postratings mod page.

Quote from: Kindred on August 06, 2024, 11:11:33 AMYeah..postratings mod was last updated for 2.0.3.  You can be fairly certain that it does not support modern php or possiubly mySQL versions...   the solution would be to ask in the post ratings mod support thread or uninstall the mod

Kindred

You need to have thr text string defined in English too, I believe
Сл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."

FragaCampos

But it is  :-\


Quote from: Kindred on August 07, 2024, 06:04:07 AMYou need to have thr text string defined in English too, I believe

Steve

My pet rock is not feeling well. I think it's stoned.

FragaCampos


Kindred

Well, honestly,  the only real solution is upgrading to 2.1.x
Сл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."

Sir Osis of Liver

Quote from: Sir Osis of Liver on August 05, 2024, 02:06:49 PM2.0.19 supports php 8.0, it will run in 8.1 but log errors.

If upgrade to php 8.1 crashed the forum, that's most likely due to a mod that won't run in 8.1.  You can clean up the 2.0 install by uploading clean files and remove hooks with repair_settings, that will remove all mods and forum should run normally.
When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: