Jump to content
Larry Ullman's Book Forums

Recommended Posts

I have problems understanding what permissions to use for a secure folder. Reference page 341.

 

Can you help me understand UNIX permissions for a secure folder. I understand the permissions' matrix --- 777, 755 etc. My problem is understanding how tight the permissions can be set and still allow the php code to execute --- 644, 544, 444 or is it 755 etc.

 

My web site is on a common server. Uploads are permitted but I use chdir to change the permissions before upload in the upload script and use chdir to revert after the upload.

 

Just bought and read your book. It is a very nice update. Thank you for sharing your knowledge. As you say "Your book isn't just the greatest book ever written, period! It totally blows 'One Hundred Years of Solitude' out of the water."

Link to comment
Share on other sites

Thanks for the nice wordsw. It is appreciated. Yes, Unix permissions are confusing. I'm not sure what you mean by "PHP code to execute", but if you mean that PHP needs to move a file to the directory, then the permissions need to be 755.

Link to comment
Share on other sites

I meant to explain the ability to call this PHP page from another page on the website and have the PHP page perform its script. I am concerned this PHP script could be blocked if directory permissions are too tight. How tight could they be -- 644, 544, 444 ?

 

The script on this PHP page relaxes the directory permissions for the upload and reverts permissions back to a tighter setting of 644, 544, 444 or should it remain 755?

 

I use this code to modify the directory permissions: ftp_site($conn, 'CHMOD 755 '.$MyDirectory) to allow the upload.

 

Thanks.

Link to comment
Share on other sites

If by "call" you mean include, then the directory permissions can just be 744, I believe.

 

Relaxing and reverting directory permissions for uploads is fine, unless the site gets really busy in which case that will bottleneck the entire process.

Link to comment
Share on other sites

 Share

×
×
  • Create New...