Visvanath Ratnaweera tarafından yapılan gönderiler

Particularly helpful Moodlers 'ın resmi Translators 'ın resmi
You mean starting again, going back to a snap-shot, resolved the problem? Good for you!

Yes, 4.1 is a LTS: https://moodledev.io/general/releases with security updates until Dec 2025. That doesn't mean you can keep on upgrading PHP at your wish. You must always look before you jump: https://moodledev.io/general/releases/4.1 > Server requirements.
Particularly helpful Moodlers 'ın resmi Translators 'ın resmi
Agree with Ken. Didn't notice your domain. Your Windows 2022 server is the VM and it is reachable from the Internet through a domain name.

Side note: I am cautious in exposing the real domain name in public forums. If you want to remove yours from your OP, you may try the Report to moderator asking to mask it.

So, your solution could be as simple as replacing the current 'http://localhost' in $CFG->wwwroot to 'http://moodle.EXAMPLE.COM' and updating your code to Moodle 4.2.3 or later - assuming that you have a compatible DBMS. See https://moodledev.io/general/releases/4.2 > Database requirements.

To get that going and testing Moodle you can continue with HTTP. Tackle HTTPS (and certificates) later.
Particularly helpful Moodlers 'ın resmi Translators 'ın resmi
You want to make Moodle running in a virtual machine accessible in the Internet. Is the host, the machine running the virtualization software, in your case the Windows 2022 server, is it accessible from the Internet? If so how exactly, through a public IP address or a domain name (or both)?