PHP – How to Activate Built-in PHP in macOS Server 5

macosPHPserver.app

On our macOS Server 5.2, I want to run a PHP site. So my idea was to use the built-in PHP in OS X Server by simply ticking the checkbox "Enable PHP" in the Server app at the Websites general configuration page.

However, when I open a page like test.php with some PHP code in it from a browser, the PHP code is not being interpreted but just delivered as is.

What am I missing?

Best Answer

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.