3
Reading the manual of PHP
and some tutorials I was in doubt about which permission to leave in the folders after uploads of images. Some tutorials tell to leave as 0755, others as 0750, which to use in this case for the security of the application and server on the web?
1st Example:
chmod ("/arquivo/diretorio", 0755);
2nd Example:
chmod ("/arquivo/diretorio", 0750);
There is not a single correct way. You have to understand how it works and use the one that suits your specific case. Copying from somewhere is a bad idea.
– Bacco
@Bacco, thank you for the reply, not leaving full access or be worth 0777 ta then? If you want to leave a reply!
– Williams
The problem is that it depends on a whole series of things in the installation environment, it becomes complex an answer covering all cases. It depends on who is the Owner of the folder, depends on whether you want FTP access as well, you have to know who is the webserver user (which is usually the PHP user too), and so on. Each case is a case. In general, "the less the better" as long as the application works. If it works at 700, you don’t need 750, if you need 750, but it works well, you don’t need 755, but that’s a very big simplification. It has a lot of detail in "game". Better study and understand.
– Bacco
Got it, thanks!
– Williams
Good, but had given a search before, came many but not this! But the link helped me a lot, thanks really. ;)
– Williams
I marked the duplicate, because whoever searches this one will find the answer more detailed too, since the answer accepted is in the line of that other..
– Bacco