Firefox PHP

Unable to minor upgrade from 5.2.14 to 5.2.23

Posted by kivrael 
Unable to minor upgrade from 5.2.14 to 5.2.23
April 05, 2021 05:06PM
Hello,

With the aim to upgrade my Phorum version from 5.2.14 to 5.2.23, I am following the Admin Manual instructions explaining how to do a minor upgrade. I have done a backup of the website files as well as of the database, I have downloaded the newest release of Phorum, deleted the folder include/db/upgrade, uploaded the files through FTP to a folder inside the website files, and copied the old config.php file in the new release. But when I open the website or the admin page, nothing changed.

Could anyone help me understand what I need to do to upgrade phorum version? Please let me know what I information I can give to describe more clearly my situation.

All the best,
Gabriel
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 05, 2021 09:45PM
Did you...
Quote

Extract the files and put them on top of the current installation
per instructions,
or did you create a new directory for the new files?

Please note I don't follow instructions very well.
Take screen shots of the original working phorum admin settings, anything that is not default (so everything).
while you are in the admin, empty the cache using the admin (it may take several attempts to complete properly, there is a success message) or (you might need to do it manually with a file manager or ftp).

I upload the updated Phorum to a new directory.
Transfer the config settings to the config file in the new include/ etc. , directory.
Rename the original forum" directory to forumold.
Rename the new forum directory to whatever the original forum directory name was,
then go to the forum directory.
Copy any mods needed to the new forum, and enable them, then save.

After upgrading check against screen shots to verify settings.
If something is broken, revert to the previous working phorum version.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 06, 2021 12:29PM
Thank you for your quick response. I was missing the part about renaming the new directory to the original name and the original forum to a different name. So I did it and purged the cache and when I open the admin page, I get the following :

Phorum Admin
version 5.2.23
The upgrade is complete
You may want to look through the the admin interface for any new features in this version.
Finish (button)
Fatal error: Call to undefined function phorum_db_close_connection() in /home/innocenc/www/public_forum/common.php on line 1076

I then commented out the line 1076 which just consisted of a call to this function and that took out the fatal error. However, when I press the Finish button, nothing happens. I still get the same page and I cannot access the admin interface.

And on public page, I get :

It looks like you have installed a new version of Phorum.
Please visit the admin page to complete the upgrade!

So I'm not sure if the upgrade was completed or not. Any idea how to move on from here?
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 06, 2021 04:12PM
uncomment the line 1076
try to go to the admin.

Check the php error log.
Check the web server error log. (looking for a file not found error)( or a permission error)

Check that you don't change from http to https in the middle of the upgrade
Check the path

What version of php are you on?
Did you change the location or the forum name (on most servers upper, mixed, and lower case are treated as different names | paths)

Try going back to the previous version by renaming the directories.



Edited 1 time(s). Last edit at 04/06/2021 04:13PM by Scott Finegan.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 07, 2021 08:42PM
I uncommented line 1076.

----

In order to view the php error log, I added the following lines to the admin.php file :

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

As a result, when I go to the admin, in addition to (on top of) what I copied in my previous post (ending with the fatal error), I also get these lines :

Notice: unserialize() [function.unserialize]: Error at offset 105 of 107 bytes in /home/innocenc/www/public_forum/include/db/mysql.php on line 985

Notice: unserialize() [function.unserialize]: Error at offset 59 of 153 bytes in /home/innocenc/www/public_forum/include/db/mysql.php on line 985

Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in /home/innocenc/www/public_forum/mods/embed_mp3/embed_mp3.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at /home/innocenc/www/public_forum/include/db/mysql.php:985) in /home/innocenc/www/public_forum/include/admin/header.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at /home/innocenc/www/public_forum/include/db/mysql.php:985) in /home/innocenc/www/public_forum/include/admin/header.php on line 167

----

I found the server error logs in the web host control panel, and there are two that come up. The first one continuously (about 1000 times a day), with different client IP addresses :

AH00687: Negotiation: discovered file(s) matching request: /homez.918/innocenc/www/index.html (None could be negotiated).

The other one comes up only a few times a day :

AH01264: script not found or unable to stat: /homez.918/innocenc/www/wp-login.php
(or other files than wp-login.php)

However these occur when I am not attempting the upgrade. I could not find a way to see the server error log in real time, only the history of the ones occuring on the previous days, but yesterday I attempted the upgrade and there are no extra errors than these two in yesterday's log.

----

The admin page loads instantaneously with 'The upgrade is complete' and there is a 'not secure' warning next to the url so I don't think it changes from http to https.

----

I don't know how to check the path. Though I found the file rebuild_forum_paths.php in the root directory of the phorum which is exactly the same for the original and new forums.

----

The PHP Version of the server is 5.2.17

----

I did not change the location or the name of the forum, and when I rename the directories as before, I get back a working website.


Do you have any clue how I can proceed from here?
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 07, 2021 09:11PM
Compare the common.php from the two installs to start.
Is there a .htaccess in the 5.2.14 directory that is not in the 5.2.23 directory?
Check permissions on the directories and subdirectories. (both installs, new old)
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 08, 2021 10:46AM
I have compared common.php files with an online tool. The result can be found here:

https://www.diffchecker.com/WmQN09bg

I cannot see any difference which could cause a problem, but then I am not well versed in PHP. There is a change from the function rand() to random_int(), the latter not being defined in PHP 5, but it seems like the inclusion of

require_once('./include/random_compat-2.0.2/lib/random.php');

deals with this issue.

--

All the sames .htaccess files are there in the new and old installs.

--

All folders have permission 0705 (owner can read, write & execute, public can read & execute) and all files have permission 0604 (owner can read & write, public can read only)

--

I noticed that if I inspect the admin page while attempting the update, I find the following error in the console:

Uncaught SyntaxError: Unexpected token '<' javascript.php:1

Is that of any help? Do you have any more ideas of what could go wrong?
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 09, 2021 12:12AM
I would upload the files again.
There could be an extra space somewhere, or a UTF8 byte mark (which is hard to locate since it is invisible to most editors).

Any files you may have edited may be suspect.

[stackoverflow.com]
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 10, 2021 06:18PM
I have tried with a new upload and get the same fatal error: Call to undefined function phorum_db_close_connection() in /home/innocenc/www/prive/common.php on line 1076.

I also hooked up the forum to a different database in config.php in order to attempt a new installation, but get the same error. Though I can proceed anyway with the creation of an admin account, after which I get a second Fatal error: Call to undefined function phorum_db_user_check_login() in /home/innocenc/www/prive/include/api/user.php on line 1661.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 10, 2021 06:51PM
Actually I just got something different. I don't know why. This time I didn't rename any folder and used the name of the downloaded folder for the url of the forum, and I get a different error:

Parse error: syntax error, unexpected T_FUNCTION in /home/innocenc/www/Core-phorum_5_2_23/include/db/mysql.php on line 1448

It seems like this comes from the version of PHP. Should I try to upgrade the version of PHP? Which version is most likely to work?



Edited 5 time(s). Last edit at 04/10/2021 07:03PM by kivrael.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 11, 2021 12:56AM
Best to determine what is wrong without changing a bunch of stuff.
That said a separate install of php and Phorum might be worth it.

I suspect your issue may be caused by a mod.
Disable all mods, saving the settings, using 5.2.14
Re-enable the mods one at a time checking for failure after each, using 5.2.23

Tidy has been known to cause problems on some installations.



Edited 1 time(s). Last edit at 04/11/2021 01:16AM by Scott Finegan.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 11, 2021 01:35AM
Upgrading php, stay below version 7.x there are issues.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 11, 2021 11:39AM
I disabled all modules but still got errors. Then I upgraded PHP to 5.6.40 and now I don't have any fatal error anymore. However, I get the following :

phorum_dbupgrade_getupgrades(): unable to open the upgrade directory ./include/db/upgrade/mysql-patches

Indeed, there is no such directory because I deleted the folder ./include/db/upgrade on purpose since this is what the instructions say to do. Why do I get this and what should I do about it? Actually in a previous attempt, I had gotten that same message and copied the .../upgrade folder from the original phorum to the new one, but that's not what I'm supposed to do, is it?
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 11, 2021 05:52PM
Quote

unable to open the upgrade directory
Try leaving an empty folder
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 12, 2021 05:30AM
When I create the upgrade/mysql-patches folder (as well as upgrade/mysql), the message does not appear anymore, I just get an 'upgrade is complete' page with a link and button that do not respond. And if I add three lines to admin.php as before to display errors, I get:

Notice: unserialize(): Error at offset 1450 of 6454 bytes in /home/innocenc/www/public_forum/include/db/mysql.php on line 380

Warning: Cannot modify header information - headers already sent by (output started at /home/innocenc/www/public_forum/include/db/mysql.php:380) in /home/innocenc/www/public_forum/include/admin/header.php on line 34

Warning: Cannot modify header information - headers already sent by (output started at /home/innocenc/www/public_forum/include/db/mysql.php:380) in /home/innocenc/www/public_forum/include/admin/header.php on line 167

From re-reading the post you sent from stackoverflow, I see that the warning could be a consequence of the Notice message (see paragraph7 Preceding error messages). Could I use anything from the following post to fix it?

stackoverflow.com

for reference, lines 368 to 384 in mysql.php are:

$settings = phorum_db_interact(
DB_RETURN_ROWS,
"SELECT name, data, type
FROM {$PHORUM['settings_table']}",
NULL,
DB_MISSINGTABLEOK
);

foreach ($settings as $setting)
{
$val = $setting[2] == 'V'
? $setting[1]
line 385 -> : unserialize($setting[1]);

$PHORUM[$setting[0]] = $val;
}
}



Edited 1 time(s). Last edit at 04/12/2021 06:01AM by kivrael.
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 12, 2021 09:05PM
Serialized data is hard to fix.
Back everything up again :)
What I would try is create a new empty install.
Make sure you change any admin settings so they match the 5.2.23 upgrade.
Make sure to change the prefix for the table names (in the config) so you don't overwrite anything.
Verify the notices and warnings are gone.
Copy the "settings table" record from the new install, and replace the "settings table"record for the 5.2.23 upgrade.

Test again
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 21, 2021 06:03PM
Thank you very much for your help, the upgrade has finally worked. I had attempted a new installation before but without changing the table names prefix in the config file. I still got some notices but i am able to go through with the installation, create a new admin, and then I copied all the tables in the database from the original forum except for the Settings table and therefore recovered all the users and messages.

I have another question. Is there a way to activate https from the admin page?
Re: Unable to minor upgrade from 5.2.14 to 5.2.23
April 21, 2021 07:10PM
Check the following threads. I just searched on my name and " Path ", and did not reread, then grabbed the links.
You can force https in .htaccess also. If you need to do both. There may be some hard coded paths in some modules.

Automatic http path.
[www.phorum.org]
You may not need this module, however I never tested without it.

[www.phorum.org]

[www.phorum.org]
Sorry, only registered users may post in this forum.

Click here to login