Permission error

so I have issues with the move_uploaded_file() function on php, I've been using it to move tmp files, it worked once but the second time I tried it simply didn't work, so I enabled error_reporting and here is error : "Warning: : failed to open stream: Permission denied in x on line x", the first thing I did after that was checking the file permission and surely enough it was 777, so I'm pretty sure the problem is neither from my code or my file so maybe it is coming from profreehost. It would be great if any of you knows how to fix it.
Thanks for reading.
Edit: "Sorry if you are reading this, the error was just a path issue"