I had similar problems with some (but not all) methods being undefined. Final solution: "[x] Allow to interact with the desktop" among the properties of the Apache service. A real user instead of SYSTEM might also work.