1. What is the recommended method to install PHP and required extensions (php-mysql, php-xml, php-curl, php-zip, etc.) in a completely offline Ubuntu system? I would use apt-get
2. Is there a reliable way to download all dependencies in one go from an online machine and then transfer them?
From my Linux experience, installing new software is not just copying files as there is process (linking libraries, resolving dependencies?) that also needs to happen. apt handles all this.
3. Should we match the exact PHP version (8.3.6) on both systems, or can Moodle run safely on a slightly different minor PHP version? Not required, You need to set up a LAMP environment on the target machine that meets Moodle requirements.
Is there an official Moodle-recommended approach for offline LAMP stack deployment Not aware of any.
Your problem is the client computer does not have a LAMP stack ready to run Moodle. LAMP comes first - you have Ubuntu, but you need a HTTP server, and a
database and php which meet moodle requirements for extensions and version number. Once your client machine can deliver php pages over the network , you can put the Moodle zip on a USB and install Moodle offline. it is the client that is holding you up - you can't install Moodle until the framework is there.
sudo apt install php php-mysql fails due to missing repositories.
If you are not specifying an incorrect version number or mispelled, the problem is in the repositories. Maybe they are missing or disabled. If so, the client has a broken machine by accident or choice.
When trying to manually transfer .deb packages, dependency errors occur.
Takes me back to the early days of Linux when I downloaded random deb packages. Are you getting the right packages? A package manager is a far better way to install software.
We are unsure how to correctly
download and transfer all required PHP packages and dependencies from an online Ubuntu machine to the offline one.
You don't. You set up a stable LAMP server using a stable Ubuntu build, apt update and apt upgrade to get the latest packages and then install php, a web server and a database using a package manager, Then with a reliable working webserver, you use
git to install Moodle.