Hello,
Thank you for your support! However I tried both 755 and 644 for my .inc files, which are included in my .php files in this "include_once(something.inc)" manner ... I want to prevent users from reading both the .inc & .php code, but the .php need to be able to include the .inc
I tried chmod 755 .inc ... and I can still read the code from the browser! and if I tried chmod 644 .inc ... then when I include .inc in .php files, I got this error
Warning: Failed opening 'lib/something.inc' for inclusion (include_path='') in something.php on line 8
Can anyone please help on how I can achieve what I am trying to achieve?
Thank you!!!
Rich Alloway wrote:
Actually, as long as the file is readable by the web server, you'll be ok.
Mode 755 will work, but 644 would probably be more appropriate since the files aren't actually executed. They are read by the web server and then the code within is executed.
Unless, of course, you compiled PHP as a stand-alone CGI script and you're attempting to run PHP scripts from the command line, then 755 would be correct.
-Rich