I have the same issue with zentyal 6.2 based on ubuntu 18.04. Unfortunately, both of your solutions did not work in my case.
As you can read here, the same problem is not present if apache is configure via PHP fast-cgi. However this solution has some problem with latest versions of moodle (3.8.2 and 3.9).
So, at the moment, I have to maintain the warning.