Hi, if a script requires some files and folders to be chmoded 777, is there a way to make 755 act as if it were 777? or get a script to work with 755 if it is required to be 777? Is there a way to set this up on the server?
It really depends on which user is creating the files, which user the web server is running as, and so on. Without more information it's not possible to give a valid answer to your question.
If all the files are being created by Apache, and also accessed by PHP running as an Apache module, then 755 vs 777 shouldn't make a difference. If the situation is more complicated then it may or may not make a difference. If you don't understand the ramifications of this then you may want to get some assistance administrating your server, for your own sake and your sites' security (not from me; I'm not looking for work).
Ok. The reason i am asking is because when i file is uploaded, it is automatically moved to another folder when converted. When the folders and chmod 755 it says cannot move uploaded file. When the folders are chmod 777 i get an error that says cannot update database. So im not sure what is going on. Yet when i test it on a different server with a web host, all the folders are chmod 755 and everything works great, so im thinking it's something in the server configuration, but i could be wrong
It might be that the folders on the non-working server is set up with different user privileges than needed. For instance, if the owner of the folder is not the webserver/apache/php or something similar. 755 should be enough for anybody, to paraphrase. You should really never have to have a 777-folder on the webserver.
Sounds like you used the command-line rather than PHP to make the directory into which you're trying to call move_uploaded_file(). Use 'ls -l' to look at a file or directory that was created with PHP and take note of the owner. Then use chown (as root) to make sure your move_uploaded_file() target directory has the same owner.