0

I want php to create a folder that can store images for a user. So when someone succesfully creates an account a directory is created in the Images folder. I used the php mkdir function to create the directory, but i get an error saying permission denied. Doing some research i realized i need to edit the htaccess file to give permission to create a directory. Can someone give a link or tutorial on how to do this?

TLDR:I have a website on a godaddy server using Apache. Can someone guide me in right direction when it comes to editing the htaccess file to give permission for php to create a directory?

Thank you,

Pawel Mniszak
  • 21
  • 1
  • 1
  • if you have full control over the server this might help you: http://stackoverflow.com/questions/2900690/how-do-i-give-php-write-access-to-a-directory – s_qw23 Apr 26 '13 at 21:56
  • htaccess has NOTHING to do with file system permissions. except for `php_value` directives, there is NOTHING a .htaccess can do to stop php doing anything it wants to. – Marc B Apr 26 '13 at 21:56
  • Disagree with Marc B's comment - but that's going off topic. Certainly htaccess has **nothing** to do with solving the problem here. How you fix filesystem issues is specific to the operating system (and sometimes to the filesystem, and other access control mechanisms) and you have not even told us whaT OS this is running on, never mind what level of access you have to the system. – symcbean Apr 26 '13 at 22:06

1 Answers1

5

Give the target dir's parent adequate permissions.

For example, if you are trying to create a dir at /app/uploads/username/ Make sure /app/uploads/ has permission.

Login into your FTP, right click /uploads/, change permissions to 755/777.

Adrian
  • 1,046
  • 7
  • 12