Ibrahim Azhar Armar
Ibrahim Azhar Armar

Reputation: 25755

need help understanding file permissions setting for the PHP application

i have developed an application on Macintosh using MAMP

when i upload it to the server which is powered by Cpanel11, CentOS 5.. it gives several error regarding file permissions by default it gives 0700 file permission to most of the files which does not work within my server. i would want to know how do i apply the file permission settings for my PHP application,

the directory structure or the rule i want to apply is for the following conditions.

a)File uploading Directory

b) most of the php file is using include_once()

c) the normal php files which communicates with each other.

thank you

Upvotes: 1

Views: 129

Answers (2)

Ayaz Malik
Ayaz Malik

Reputation: 138

Try chmod after move_uploaded_file.

Upvotes: 0

initall
initall

Reputation: 2385

File uploads in PHP first hit the defined temporary directory (see 'upload_tmp_dir' directive in your PHP.ini) and finally your intended destination directory (PHP command "move_uploaded_file").

Your PHP process runs as a certain user that needs to own the destination directory or is in a group that is allowed to write to this directory - unless the whole directory is not writable for everyone (it's not in your case).

Upvotes: 1

Related Questions