I have an upload image feature in my website. I tried it in my localhost and it was working fine. Now I hosted it, and the following error occured:
move uploaded file failed to open stream permission denied
I checked the error online and found that by changing the chmod to 777, it can be solved.
I tried the same, and it worked. Even just 713 is working fine. But giving 777 permission is not good due to hacking possibilities.
Is there a way around this? I have right now changed the chmod to 713 until I can get a better solution for the same.
I have currently hosted in Google Cloud Platform with Ubuntu 16.04 image