File permissions for move file error in php
Posted on 2014-01-21
There is a page that lets the user upload a pdf and file it. It has worked for at least 5 years but it stops working.
When I looked at it i tried to fix it quickly for one instance by uploading the file manually using the Dreamweaver ftp client. But this failed with a permission error in the ftp log.
Through testing I found that the folder was owned by nobody with permissions 755. The php script couldn't move a file into that folder. And my ftp client couldn't. Through messing with it I found that if I made the owner the "siteadminusername" and then made the permissions 777 the php page was able to work for that one instance.
So should I change the permissions of all the folders that exist (around 900) or change the php code to work properly with the original permissions. As it did previously I assume.
I've been figuring it out via trial and error, but I'm not sure what to do next to resolve the issue.