How to activate built-in PHP in macOS Server 5?
Usually, it is not necessary to do something like this when configuring services using the Server app, but in this case I had to manually restart the web service:

sudo serveradmin stop web
sudo serveradmin start web


After that, the PHP on my page was interpreted as expected.