Unfortunately this script wasn't designed to run under VHC. Simplest solution is to clone it and modify for use by VHC.
-- GeorgeClark - 28 May 2017
Michael, I created the VHC Item14408 branch to fix this and a bunch of other issues I've noticed trying to get VHC running on nginx. If you could check over my commits on this branch I'd appreciate it. I'm a little unsure on a couple off them but it does seem to be running fine now on nginx.
-- GeorgeClark - 28 May 2017
I've release all those fixes in 2.o
-- MichaelDaum - 20 Jun 2017