mkdir() failed (Permission denied)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

mkdir() failed (Permission denied)

Post by patrikG »

Hi all,

when I do a mkdir() on one of my websites, I get

" mkdir() failed (Permission denied) "

Does anyone know which parameter needs to be set to allow PHP to create directories?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

it's most likely not a setting in php but a problem with filesystem permissions.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Sorry wasn't clear in what my problem was: which parameter in php.ini must I set or change to allow that?
User avatar
lazy_yogi
Forum Contributor
Posts: 243
Joined: Fri Jan 24, 2003 3:27 am

Post by lazy_yogi »

if ur on linux .. you need to do from the command line :

chmod a+rx script.php (where script.php is where u call mkdir from.)

if that doesnt work, try

chmod a+rwx script.php
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Ooops. I was sure I had set chmod to 775. In fact it was set to 755... :oops:
Thanks :)
Post Reply