Upgrading from 2.4.3 to 2.6+

Upgrading from 2.4.3 to 2.6+

by Troy Patterson -
Number of replies: 6

I'm upgrading a Moodle instance from 2.4.3 to 2.6+. However, when I do the upgrade, I get an error message:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /*******/*******/public_html/pd/lib/setup.php on line 806

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /*******/*******/public_html/pd/lib/setup.php on line 806

Parse error: syntax error, unexpected T_STRING in //*******/*******/public_html/pd/lib/setup.php on line 806

Line 806 contains the following text:

\core\session\manager::start();

I have upgraded another installation (from 2.5 though) and that one works fine. The line is the same on the one that works. 

Any ideas on how I can safely correct this? 


Thanks. 

Average of ratings: -
In reply to Troy Patterson

Re: Upgrading from 2.4.3 to 2.6+

by Troy Patterson -

Well, I'll leave this in case someone else has a similar issue. I hadn't copied over the .htaccess file. Once I did copy that, everything works. 


Cheers. 

In reply to Troy Patterson

Re: Upgrading from 2.4.3 to 2.6+

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

For the record, the file .htaccess is not required by Moodle but by the hosting package of the user and among its potential goals there is addressing the usage of a PHP version greater than 5.3.2, being a 2.6+ requirement: the error above comes from an incorrect PHP version, lower than 5.3.0.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Upgrading from 2.4.3 to 2.6+

by Brian Merritt -
Picture of Particularly helpful Moodlers

Thanks Matteo

Wouldn't it be nice if the setuplib.php checked the version on an upgrade smile

In reply to Matteo Scaramuccia

Re: Upgrading from 2.4.3 to 2.6+

by Brian Merritt -
Picture of Particularly helpful Moodlers

I've raise this as a tracker, as I am sure other people have fallen down this hole

Average of ratings: Useful (1)
In reply to Brian Merritt

Re: Upgrading from 2.4.3 to 2.6+

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle does check the PHP version on upgrade. However, if you PHP version is too old, that code will not work.

You can even check the requirements before you upgrade. Before you upgrade, go to Admin -> Server -> Environment in you existing site, and you can check the requirements for any other version of Moodle.

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: Upgrading from 2.4.3 to 2.6+

by Ryan Archer -

Holy crap on a cracker!

Thank you you Matteo! I spend many hours last night looking into various php files, server error logs and consulting live chat with my web host.

Wow! Yeah I wish I would have got a more understandable error message about this. You'd think most big commercial hosting servers would be running on 5.3.0+ as default by now!