Upgrade to latest 3.4.2+ from 3.4.1

Upgrade to latest 3.4.2+ from 3.4.1

por Jan Combrink -
Número de respuestas: 7

I am trying to upgrade from a 3.4.1 to 3.4.2+ moodle version.  It is a working installation.  I have now tried twice to do the upgrade, with a roll-back to the older version in-between.  The older version works, but when I try to run the new instance, it gives the following message:

This page isn’t working

eptdev.eptglobal.co.za is currently unable to handle this request.

HTTP ERROR 500

I have asked the hosting company to check the log files (Ido not have root access) and they reported as follows:


Hi,

Upon checking I could see the following error message in the logs:

====
[28-Apr-2018 11:08:59 UTC] PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/eptgldwj/public_html/eptdev/lib/classes/component.php on line 1266
[28-Apr-2018 11:09:00 UTC] PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/eptgldwj/public_html/eptdev/lib/classes/component.php on line 1266
[28-Apr-2018 11:10:18 UTC] PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/eptgldwj/public_html/eptdev/lib/classes/component.php on line 1266
[28-Apr-2018 11:13:13 UTC] PHP Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/eptgldwj/public_html/eptdev/lib/classes/component.php on line 1266
====

Please consult you developer and check for the issue. In case of any further requirements do let me know.

Also, I could see some cgi errors. Hence I have tweaked the values to prevent the same.

Warm Regards,
Ashmita G

Afrihost.com

The line 1264 - 74 :  

* @return array an associative array of components and their corresponding paths.

     */

    public static function get_component_list() : array {

        $components = [];

        // Get all plugins.

        foreach (self::get_plugin_types() as $plugintype => $typedir) {

            $components[$plugintype] = [];

            foreach (self::get_plugin_list($plugintype) as $pluginname => $plugindir) {

                $components[$plugintype][$plugintype . '_' . $pluginname] = $plugindir;

            }

        }

It seems to be a mod issue,  I have checked that the mods are all the same, old and new.


Would anyone be able to assist, please.  

Jan







Promedio de valuaciones (ratings):Useful (2)
En respuesta a Jan Combrink

Re: Upgrade to latest 3.4.2+ from 3.4.1

por Howard Miller -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

It's the colon before the 'array' in the function declaration. Almost certainly, you don't have PHP 7.x. Which begs the question, how did you run 3.4.1?


The colon syntax in functions was new in PHP 7. Earlier versions will flag it as an error.

Promedio de valuaciones (ratings):Useful (2)
En respuesta a Howard Miller

Re: Upgrade to latest 3.4.2+ from 3.4.1

por Jan Combrink -

Thank you, Howard.  You were spot-on.


The reason why the "old version" ran was because of inherited and variable PHP settings, and the way we do moodle upgrades,  ie that we rename the old version, create a new url with the old name and install.  Will definitely remember next time!


Maybe a warning, in the beginning, might save some time - if that is possible.


Thanks again, took all of 5 minutes to solve a 12 hour problem.


Jan

Promedio de valuaciones (ratings):Useful (1)
En respuesta a Jan Combrink

Re: Upgrade to latest 3.4.2+ from 3.4.1

por Howard Miller -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

I'm a bit sceptical. Moodle should refuse to upgrade if the version of PHP (or any other dependency) is not suitable.

However, yes, always check the release notes parpadeo

Promedio de valuaciones (ratings):Useful (1)
En respuesta a Jan Combrink

Re: Upgrade to latest 3.4.2+ from 3.4.1

por Dan Salahi -

Hi Jan. I have got the same issue on my project. How shall I solve it? Would you please explain that? 

En respuesta a Dan Salahi

Re: Upgrade to latest 3.4.2+ from 3.4.1

por Nicholas Fahey -

Found this error on my shared hosted server as well while trying to run cron. The site works fine otherwise. Running 3.5. Cron won't work because of it.

En respuesta a Jan Combrink

Re: Upgrade to latest 3.4.2+ from 3.4.1

por Zakir Hossain -

i have same problem on xamp 5.6

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /opt/lampp/htdocs/moodle/lib/classes/component.php on line 1266


I just download xamp 7.0. It working fine.