ok now I added a few extra debug statements here and there to that piece of the code but it just started working without me doing anything else

Actually this is ridiculous, I also was contacting the webhost and they were claiming that they didn't change anything etc etc... but I also tried uncommenting the cwd line and that seems to work again now too

It is obviously not the code's fault...
Sorry to bother you with this, thanks again!