I have experienced this problem many times and finally solved it as follows:
- Install Ubuntu 22.04 from scratch on the server. No matter what I did on 24.04, I could not run MariaDB properly. Although I was able to install it, it crashed afterwards. It works more stable with 22.04.
- Install OLS or Ngnix and install php 8.3
- Finally, select MariaDB from the MySQL installation and install it so that it will compile on the server, do not install the compiled version.
Depending on your server processor power, this compilation process may take up to 4-5 hours. I recommend installing btop or htop from SSH and checking the processor load every now and then to see if the installation is complete. You can close the panel during this compilation period, I recommend starting this process before going to bed at night.