I've tried your suggestion and modified the payload delivery method and tried also the php_eval module, against my test environment, but I can't seem to make it work besides the way I've implemented in the first place.

I maybe missing something, but it seems that this is the only reliable way I can drop a shell on the server.

It's not elegant but it works.