Error on fresh installation

Error on fresh installation

by Thoriq Adillah -
Number of replies: 4
I have issue after fresh moodle installation that says

```
Exception - Typed property DOMAttr::$name must not be accessed before initialization
Debug info:
Error code: generalexceptionmessage
Stack trace:

    line 267 of /lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php: Error thrown
    line 222 of /lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php: call to HTMLPurifier_Lexer_DOMLex->transformAttrToAssoc()
    line 118 of /lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php: call to HTMLPurifier_Lexer_DOMLex->createStartNode()
    line 90 of /lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php: call to HTMLPurifier_Lexer_DOMLex->tokenizeDOM()
    line 213 of /lib/htmlpurifier/HTMLPurifier.php: call to HTMLPurifier_Lexer_DOMLex->tokenizeHTML()
    line 1971 of /lib/weblib.php: call to HTMLPurifier->purify()
    line 1759 of /lib/weblib.php: call to purify_html()
    line 3010 of /lib/weblib.php: call to clean_text()
    line 750 of /admin/index.php: call to redirect()
```
Everything was basically almost copy and paste with slight modification from this link https://docs.moodle.org/402/en/Step-by-step_Installation_Guide_for_Ubuntu

After all requirement are met on installation screen (except https), I pressed continue and left it, and after I came back, it was the error that greeted me

How do i resolve this issue? Thank you in advance

My setup
- OS: Fedora 37
- PHP 8.1.19
- Web server: httpd
- Database: postgresql 14.3
- Moodle: 4.2
Average of ratings: -
In reply to Thoriq Adillah

Re: Error on fresh installation

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you just re-run the installation from where it stopped (just go to Moodle's home page URL), do you get the same issue?

It seems to be failing where Moodle is about to create the admin user.
In reply to Howard Miller

Re: Error on fresh installation

by Thoriq Adillah -
Yes sir, the error still persist. Basically, it was just the error and continue button. When the button is clicked, it just refresh and won't go anywhere
The error above is because I add some lines on config.php to force the debug info
Attachment WhatsApp Image 2023-06-05 at 20.51.31.jpeg
In reply to Thoriq Adillah

Re: Error on fresh installation

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I have no idea sad

I would ask you to check very carefully that you have all the versions of software you think you do. Especially PHP (note, 'php -v' at the command line tells you nothing).
In reply to Howard Miller

Re: Error on fresh installation

by Bruno Baudry -
Picture of Core developers
For those that would stumble upon that. Upgrading to php 8.2+ did the trick for me.