"expecting variable" error installing moodle-latest-402

"expecting variable" error installing moodle-latest-402

Kobus du Toit -
回帖数:7
Hi

I can't post my whole text because it gets detected as spam.  So I will add replies to this and see what works.
I have PHP version is 8.2.8 installed
I have sodium support => enabled

I am getting the "expecting variable" error adminlib.php on line 3899
回复Kobus du Toit

Re: "expecting variable" error installing moodle-latest-402

Kobus du Toit -
I will add bits to try and get past the spam filter

This error is showing up on install. It seems this happens when the wrong PHP is installed. I have 8.2.8 installed
Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /var/www/html/moodle/lib/adminlib.php on line 3899

My Ubuntu is updated

sudo apt update && sudo apt upgrade
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


My PHP version is 8.2.8

PHP 8.2.8 (cli) (built: Jul  8 2023 07:09:59) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.8, Copyright (c), by Zend Technologies


I have sodium installed

sodium
sodium support => enabled
libsodium headers version => 1.0.18
libsodium library version => 1.0.18

回复Kobus du Toit

Re: "expecting variable" error installing moodle-latest-402

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
No Moodle release as of today, July 2023, is compatible with PHP 8.2. See MDL-76405. For general compatibility check the release notes available via https://moodledev.io/general/releases.
回复Visvanath Ratnaweera

Re: "expecting variable" error installing moodle-latest-402

Kobus du Toit -
Do you maybe know the command line how to install the correct php and related components on Ubuntu? 
回复Kobus du Toit

Re: "expecting variable" error installing moodle-latest-402

Leon Stringer -
Core developers的头像 Particularly helpful Moodlers的头像

Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /var/www/html/moodle/lib/adminlib.php on line 3899

This error indicates your web server is using PHP 7.4. Access a file containing phpinfo() from your browser and see which version is reported at the top.

If you've recently upgraded PHP maybe your web server process needs restarting to apply this change (for example, with systemctl restart php-fpm). Or maybe your server is configured to use different PHP versions for the command line and web server, in this case PHP 8.2 and PHP 7.4 respectively.

回复Leon Stringer

Re: "expecting variable" error installing moodle-latest-402

Kobus du Toit -
This helped. Thank you.

I saw apache kept on using php7.4 even after installing 8.1 and 8.0

I ran these commands to change to using 8.0
sudo a2dismod php(yourversion)
sudo a2enmod php5.3

Now I am on the installation page 微笑
回复Kobus du Toit

Re: "expecting variable" error installing moodle-latest-402

Kobus du Toit -
I had to change this command to specify php8.0 to get things to move forward

sudo apt install apache2 mysql-client mysql-server php libapache2-mod-php graphviz aspell Ghostscript php-pspell php-curl php-gd php-intl php-mysql php-xml php-xmlrpc php-ldap php-zip php-soap php-mbstring
回复Kobus du Toit

Re: "expecting variable" error installing moodle-latest-402

Mary Cooch -
Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Testers的头像 Translators的头像
Sorry your new post got marked as spam. As I explained in the support channel, there are restrictions on new accounts posting links (which is what spammers like to do) but once your account is a bit older you'll be able to post links when you want. I see you are getting advice here now, so that's good.