So I'm attempting to install Joomla on a lemp stack, ubuntu 16.04, php7. I use the same lemp stack for Wordpress sites all the time no hassle. I unzipped the Joomla files into my /html/ directory and I'm getting the above error. It doesn't tell me a lot.
When I googled it I found a lot of people getting the same error with a few extra lines that seemed to be related to the database however as I haven't even got to the Joomla install page to give it the database username and password I find it unlikely to be the problem.
Folder/File permissions are set to 755/644 respectively and everything is chown -R www-data:www-data. If I replace index.php with the following it works fine