Can't create new folder with mkdir()

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
nbuu
Forum Newbie
Posts: 1
Joined: Mon Sep 12, 2005 12:54 am

Can't create new folder with mkdir()

Post by nbuu »

<?php

if (mkdir("/var/www/html/catalogs/mynewfolder",0777)){
echo "created ok";
}else{
echo "can't created";
}

?>

The result is always "can't create", I also set permission of "catalogs" to 777

Please tell me what should I do to solve that problem?

For more info: I installed Fedora 3: Apache 2., PHP 4.3.9, Mysql 3.23.58

Thanks very much,
Nguyen Buu
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yar, I sees ya furgot to read de sticky things, yar.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

feyd wrote:yar, I sees ya furgot to read de sticky things, yar.
~Burri convinced you eh?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

its probably because you are not in the /var/www/html/catalogs/mynewfolder folder at the time. if the php file is in the catalogs folder then it would just be mkdir("/mynewfolder") usually. give that a try

oh and just use the php and code tags where need be, makes things a lot easier on us to read. don't listen to feyd he is cranky cause he got scurvy from his lady friend (if ya know what i mean :wink: )
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

pickle wrote:~Burri convinced you eh?
arrrg...actually 't be th' other way around. I jus' jumped on th' band wagon...arrr
Post Reply