Upgrade to v3.0.3 - issues with outputrenderers.php

Upgrade to v3.0.3 - issues with outputrenderers.php

by Gary Evans -
Number of replies: 13

Installed Moodle from the web hosting section of the Control Panel (web host is 123-reg.co.uk). Version 2.3.2 was installed, but I noted that v3.0.3 is available and wanted to make sure I had latest version before I started using Moodle. Here is a summary of the steps I took (based largely on docs.moodle.org/30/en/upgrading) and the error messages I am now seeing.

1) Checked server meets requirements (Moodle>Site Administration>Server>Environment) – all seemed OK

2) Backup - I omitted the backup step as being a fresh install that had not been used I thought I could simply re-install if any issues along the way

3) Check for plugin updates – I hadn’t installed any plugins, but Moodle indicated there were 296 plugins (I assume these are installed along with Moodle itself), but clicked ‘Check for Updates’ anyhow – all seemed OK

4) Maintenance Mode - enabled this mode (Moodle>Site Administration>Server>Maintenance Mode)

5) Downloaded Moodle v3.0.3 zip file to my laptop and then FTP’d it to public_html folder

6) Created a new sub-folder called ‘oldmoodle’ and then moved everything within the Moodle folder into it – I understand that it is not possible to simply overwrite

7) Unpacked zip file – wasn’t asked to specify a location, but afterwards I checked the Moodle folder and everything seemed fine

8) Copied the old config.php and .htaccess files from oldmoodle into the Moodle folder

9) Final step should have been to trigger the upgrade process by taking out of maintenance mode, but this is where it all went wrong

10) When I tried to access www.followthemoney.co.uk/moodle rather than seeing the usual front page I saw a warning that “Moodle 2.7 or later require at least PHP 5.4.4 (currently using version 5.3.29). Please upgrade your server software or install older Moodle version”

11) I saw on the 123-reg site that it is relatively easy to switch PHP version, so I switched it to 5.5 thinking this would resolve it, but I now see the error message “Parse error: syntax error, unexpected '[' in /websites/123reg/LinuxPackage22/fo/ll/ow/followthemoney.co.uk/public_html/moodle/lib/outputrenderers.php on line 112

12) The doc referred to in opening paragraph does mention a file called config-dist.php, but I am unsure as to whether this is relevant or, if it is, what exactly I need to do to resolve

a) Doc suggests mapping config.php settings based on what it says in config-dist.php (although not sure that really helps me understand what I need to do)

b) Config-dist.php itself suggests a different approach and effectively seems to be saying overwrite config.php with this file

 

Although a reasonably competent user (I managed to design and publish my website using WordPress for example), I am not an IT specialist and this was a slightly more challenging (and manual) upgrade than what I am used to. I am so close, but not quite there – can anyone help?


PS - Lines not numbered when I edit outputrenderers.php, but counting lines manually (including any instructions/comments), line 112 says "'pragmas' => [Mustache_Engine::PRAGMA_BLOCKS]));" - means absolutely nothing to me!!!

Average of ratings: -
In reply to Gary Evans

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Did you restart php after upgrading?  Do you have an .htaccess file in your old moodle folder?  Sometimes that is needed on webhosts?

I suspect this is still a php issue...

In reply to Emma Richardson

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Gary Evans -

Restarting php - I have no idea how to 'restart php'. A 123-reg help article stated that switching php version can be done via control panel (123-reg control panel>Web Hosting>Web Tools>Switch php version). Once version 5.5 was selected from drop-down list there was just a button labelled 'Update' - text underneath stated "Choose php version for all php files on your website to execute as". Just went back into this tool and it shows 5.5 on list suggesting the change was made successfully. Don't know how to check definitively.


.htaccess - there was indeed such a file in my original installation of Moodle v2.3.2 so once I had unzipped Moodle v 3.0.3 I copied this file into the Moodle folder from the folder called 'oldmoodle' where I had moved all the original Moodle files (in case of emergency!) prior to unzipping the new version. I also copied (as instructed) the original config.php file from 'oldmoodle' into the Moodle folder.


I appreciate your suggestions, but it seems that these steps have already been done. Thanks.

In reply to Gary Evans

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Ken Task -
Picture of Particularly helpful Moodlers

Think she meant restart apache ... cause testing via curl the following shows for the domain:

Server: Apache
X-Powered-By: PHP/5.3.29

And it appears you have a WordPress at document root ... first thing that's served by the domain.   Wonder if there is an htaccess rule or some config for WP that might be an issue. (don't know that there is, just askin'!

'spirit of sharing', Ken


In reply to Ken Task

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Gary Evans -

I'm beginning to get the sense that I may be beyond the limit of my skills - I have heard of Apache, but no idea what it does or how to restart it and you are right there are .htaccess and config.php files in root, but I have no idea re their content, function or how to determine if any conflicts etc. As I said in my original request, I am a reasonably competent user, but not an IT specialist. Although I have downloaded, installed and upgraded dozens of programs on various desktops/laptops over the years and successfully developed my own website using WordPress, it seems that installing/upgrading Moodle requires more knowledge than I have. I thought by now I would be getting to grips with creating e-learning courses rather than being stuck at Step 1 trying to get it to work. I have requested support from my web host, so maybe they will be able to help.


Appreciate your help.

In reply to Gary Evans

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Gary, it appears that you have a hosted web server, and that you installed Moodle using a one-click install application.  This is exactly how I started using Moodle.  It worked well for me.  I seem to recall that I too had noticed that there were newer versions of Moodle available, and I desired to upgrade.  But I did not know how.

Well, these one-click installs do a good job get you going, but (normally) a bad job upgrading moodle.

My skills were also a bit limited, but over time, I learned about moodle and eventually succeeded upgrading!  But this takes time and education.  So you are in the same position.  First, try using your current version for awhile.  Then, eventually, learn how to install a new copy of moodle from scratch, on your own.  Folks here can help, and the moodle docs are also very good.  But you will be learning things one at a time along the way.  I am not a network or IT support specialist, I am just a professor, but I have been running Moodle for around 7 years.

In reply to Gary Evans

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Don't give up - you are very close.  Your webhost should be able to help you get there.  Basically, the website does not know that you have upgraded php.  I am hopeful that your webhost will be able to fix that for you and get you up and running.  It could just be a matter of changing a line in the .htaccess file so that it is pointing to the correct php version.  It differs with every host so hard to know exactly what step you need for sure.


In reply to Emma Richardson

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Emma made me think about something.

On my GoDaddy hosted web server, and in cPanel, I have the option to upgrade my php version myself.  In a group called "Software" there is an icon labeled "Select PHP Version."  Not all cPanels have this, however.  Check yours.

In reply to Gary Evans

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Usman Asar -
Picture of Plugin developers Picture of Testers

.htaccess file doesn't have to be moved, as long as you have it on your root folder, unless you have done changes effecting /moodle only.

regarding help from your web host, I'll tell you straight away, they can't and may will not for I have had reg-123 as my domains registrars and never found them to be very competitive in terms of scripts that are unusual (like Moodle), so making not just reg-123 but almost 99% of the hosting companies raising hands when it comes to moodle (that's where Moodle partners come in).

If you haven't started using your Moodle already, I'll link the manual installation videos (though old still works) they may be of some help.

For managing moodle, once you're done with upgrades, you'll find it way easier, so don't just panic, for I still remember my hands trembling doing upgrade first time.


In reply to Usman Asar

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Ken Task -
Picture of Particularly helpful Moodlers

I've not hosted with the provider, but do know that some providers do use .htaccess to set php versions.

See:

https://www.google.com/search?q=htaccess+to+change+php+version&ie=utf-8&oe=utf-8

The provider where hosted (reg-123) might do it the same way.   They do have customer KB, etc at:

https://www.123-reg.co.uk/support/

And it does have search ...

https://www.123-reg.co.uk/support/search.aspx?q=php+version

https://www.123-reg.co.uk/support/answers/Web-Hosting/Website-Help-and-Diagnostics/how-to-switch-the-php-version-4235/

Above, they do mention .htaccess

'spirit of sharing', Ken

In reply to Ken Task

Re: Upgrade to v3.0.3 - issues with outputrenderers.php

by Gary Evans -

Thanks everyone for your help - never known a forum that provides answers so quick!!! Between you all I think you have found the solution. 123-reg support have amended the .htaccess file in the root to enable php v5.5 - it hasn't resolved it quite yet, but I think that is simply because there is also an .htaccess file in the moodle sub-folder (which takes priority I believe). I have asked 123-reg to confirm what changes need to be made to that file as, although I can clearly see an 'AddHandler' line which seems to be the line that enables php v5.5, there are a couple of additional lines that may or may not also be relevant.


I am hopeful that this will resolve and I will be able to start getting to grips with using Moodle itself.


Thanks everyone once again.

In reply to Gary Evans

Re: Upgrade to v3.0.3 - issues with outputrenderers.php (version 3.0)

by Luis Ibhiabor -

Hello Folks,

We are in a situation that made me to follow this thread. We have a problem with the outputrenderer.php file.

Our moddle site was working well on a fresh installation of moodle 3.0. Users didn't have any problem logging in. No changes were made to it at any time and everything had been runing well. Suddenly, we visited the site (http://kassop.nuguide-vle.com/) only to receive the error message below.

"Parse error: syntax error, unexpected '[' in /usr/local/apache2/htdocs/mywebsite-moodle/lib/outputrenderers.php on line 110"

In my attempt to fix the error, I opened the outputrenderer.php and line 110 has the code below.

"'pragmas' => [Mustache_Engine::PRAGMA_BLOCKS]));"

My php text editor actually highlights that line in red.

Could someone advise me on what to do to resolve this issue, please?

Your help will be very  much appreciated.

In reply to Luis Ibhiabor

Re: Upgrade to v3.0.3 - issues with outputrenderers.php (version 3.0)

by Fumikazu Iseki -
Picture of Plugin developers

Hi,

I also had the same problem.

Although I have compiled PHP myself, it seems because the yum of the system (CentOS) has downgraded the PHP.

When I re-compile and re-install PHP, the problem has been resolved.

Thanks.