Maybe I should run it inside Docker, where the environment is simpler and more controllable.
I am using the Free version of 3CX as a replacement for Asterisk + FreePBX, which I have got tired of updating every couple of years. However, if 3CX is so difficult to get working, then I may switch...