Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Permission Denied Error When Using Mkdir

security permission mkdir denied upload

  • Please log in to reply
2 replies to this topic

#1 bleastan


    CC Regular

  • Member
  • PipPipPip
  • 47 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP

Posted 01 June 2012 - 04:18 AM

Hi peoples,

Im running into a problem and this is one of those problems i really dont know how to fix. Usually google gives me enough pointers to help me through the day but this time i am stuck.

I want to use the php mkdir() function to create a temporary directory to put images in. After i processed the images i want to delete the directory again.

When i try to execute the mkdir function on my localhost it works fine but when i upload it to my host i get the following error:
Warning: mkdir() [function.mkdir]: Permission denied in /folder

I also get an error when i try to use the chmod() command:
Warning: chmod() [function.chmod]: Operation not permitted in /folder

Now i know it has something to do with rights (i got that far) but I really cant find any way to fix this. Do i need to contact my host (and if i do.. what do i ask him :)?).

Im desperatly seeking answers to this question for several days now cause i dont wanna set a folder on the server fully open just to upload images to it.. it doesnt seem safe :)

If anyone can help me, or put me in the right direction, or give me any clue it would be very much appreciated.
  • 0

#2 WingedPanther73


    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 01 June 2012 - 10:54 AM

If PHP's user process doesn't own the folder, it cannot chmod the folder or make directories in it.

You'll have to adjust the permissions (probably as root) appropriately.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/

#3 papabear


    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 472 posts
  • Location:DarkSide

Posted 01 June 2012 - 04:32 PM

have you already tried changing the folder rights using an ftp?
If yes, what are the steps that you have already did?
  • 0
Life has no CTRL+Z
Never Forget To HIT "LIKE" If I Helped

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download