My moodle version was 4.0.2 using php 7.4. Recently I have upgraded my moodle to 4.2.2 version. Once I did the upgrade I got an error on my website saying:
syntax error, unexpected '|', expecting variable (T_VARIABLE)
I did some search and found out Moodle 4.2.2 requires php 8.0 or above. So I installed PHP 8.1 on my Server which is running Ubuntu 18.04. Once I installed php8.1 I tried to install PHP8.1 additional extension via codes like this:
sudo apt install graphviz aspell ghostscript clamav php8.1-pspell php8.1-curl php8.1-gd php8.1-intl php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-ldap php8.1-zip php8.1-soap php8.1-mbstring
when I execute this code I get lots of error indicating none of the extensions has been installed:
E: Unable to locate package php8.1-pspell
E: Couldn't find any package by glob 'php8.1-pspell'
E: Couldn't find any package by regex 'php8.1-pspell'
E: Unable to locate package php8.1-curl
E: Couldn't find any package by glob 'php8.1-curl'
E: Couldn't find any package by regex 'php8.1-curl'
E: Unable to locate package php8.1-gd
E: Couldn't find any package by glob 'php8.1-gd'
E: Couldn't find any package by regex 'php8.1-gd'
.... and the error goes on for all the extensions.
Would you please help me and tell why I can have these extension so I can run my new version of moodle? Thank You.