Error 500 while accessing a php file


I am getting error 500 while accessing a php file.

I am using CentOS 7.4 with Webin 1.870, virtualmin 6.02 and usermin 1,730. I’m using a Digital Ocean droplet with an extra 100gb disk mounted in /home (folder permission is 711).

Virtualmin Apache Error log shows:
[Sat Dec 23 22:52:07.730149 2017] [cgi:error] [pid 8217] [client my_ip:53944] End of script output before headers: php7.1.cgi

Steps I’ve taken to get this result:

I mounted my server,
I created a virtual server using the main server domain (the same one I use to connect to port 10000),
I created the SSL certificate,
I installed PHP versions 5.6 and 7.1,
I selected version 7.1 to use on that virtual server and put an index.php in the public_html folder of it,
but I’m getting 500 error while accessing the site. I have no idea why :confused:

Solved my problem going into Limits and Validation -> Validate Virtual Servers -> Fix Permissions.

Run Fix Permissions and my php started work just fine. :smiley: