After some research i found out that this is a php bug when accessing a filesystem hosted on a 64-bit OS. There's no fix for this, according to https://bugs.php.net/bug.php?id=50150, So i mounted my 64-bit windows share on a 32-bit linux machine and shared the share mounted it and it worked!
Thanks for the help anyway.