php permissions for execute only and not redable -


i have pho files when executed triggers api of sms server further sends sms. these php files triggered server data mobile no , msg. these files hosted simple shared server. permissions should give folder , files not readable public gets triggered/executed server. files contains credentials other services (like sms gateways) , hence needs safeguard.

what tried giving 711 folder becomes secret public. files 644 or 711 better option. or there should thing else done.

unix permissions distinguish between read/write/execute permissions user, group , other. "other" not mean "public", has nothing that.

a unix process runs under specific user, i.e. if log in , run program runs under user name, apache process typically runs user daemon etc. each user can belong 1 of more groups. that's 2 things user , group permissions pertain to. "other" refers user processes not fit either user or group.

e.g., file:

-rwxrw-r--  1 root  admin  5069718 apr  6 14:52 /foo/bar/baz 

is readable, writable , executable root user , readable , writable user in admin group. user not either root or in admin group has read access file. that's "other" refers to.

it's user process runs at, it's not "things on computer vs. website visitors". "website visitors" not concept covered unix permissions.

since apache typically runs daemon, make files owned daemon or @ least group daemon , make them readable , executable user and/or group. if apache needs write permissions files or directories, selectively enable write access when needed (for example, log files). whether url , therefore script accessible publicly via http controlled apache, not unix permissions.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -