i am trying to use the php gettext extension in php 5.5 (on win2008 server, using IIS7). I am doing this:
Having the same problem on Linux, I came to this conclusion: even if you provide your own *.mo files for your project, the locale itself (es) must be known to the operating system.
Installing the requested locale at a system level fixed the problem for me.
See: locale-gen
It might not help with actually debugging gettext, but at least it's something you can try.