Forum Moderators: coopster

Message Too Old, No Replies

CHMOD and PHP Files

Permissions settings for PHP files

         

bumpaw

2:36 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



Is there a quick reference for setting permissions for PHP files, and especially ones that work with user needing to Insert in mySQL database?

ncw164x

2:53 pm on Feb 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you meaning like with cgi scripts where you change the chmod,

with php you just upload to the server and they work, if you had tried to test from your hard drive then you will see errors and the code on the page.

hope this helps

ncw164x

bumpaw

4:08 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



with php you just upload to the server and they work, if you had tried to test from your hard drive then you will see errors and the code on the page.

I understand, but being paranoid I'm wondering if the files and directories on the server need different permissions than regular html files. It's the user interactive part that has me wondering.

jatar_k

4:14 pm on Feb 3, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



they shouldn't, they just need to be executable.

Only when you are having a script write to a file (not db) will you need to adjust the permissions of the file it is writing, normally.

bumpaw

7:50 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



OK That's what I was thinking, and since I'm new to PHP I needed confirmation. Thanks!

John

mykel79

10:29 am on Feb 4, 2004 (gmt 0)

10+ Year Member



Keep in mind that most of the time (depends on the server settings) a php file does not run as you the user who uploaded it, but as the same user as the web server (e.g.Apache).