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
aceconcepts
DevNet Resident
Posts: 1424 Joined: Mon Feb 06, 2006 11:26 am
Location: London
Post
by aceconcepts » Mon Feb 04, 2008 9:06 am
Hi,
I am trying to make a new directory using the following:
However, when I run the above code the following error is thrown: "Warning: mkdir(/test) [function.mkdir]: Permission denied in /home/mysite/public_html/mkdir.php on line 2".
Line 2 is the code shown above.
Any ideas why?
Zoxive
Forum Regular
Posts: 974 Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan
Post
by Zoxive » Mon Feb 04, 2008 9:27 am
PHP doesn't have permissions in that folder you are trying to make a folder.
More specificly, /folder, is trying to make it in root.
Literary /folder on a linux server.
aceconcepts
DevNet Resident
Posts: 1424 Joined: Mon Feb 06, 2006 11:26 am
Location: London
Post
by aceconcepts » Mon Feb 04, 2008 9:37 am
So how do i go about making a new folder using code?
Zoxive
Forum Regular
Posts: 974 Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan
Post
by Zoxive » Mon Feb 04, 2008 9:42 am
aceconcepts wrote: So how do i go about making a new folder using code?
Same as you have as long as php/webserver has permissions(Inside the folder you are trying to make the folder(s)).
I would definitely not recommend making a new folder in the root of a server though.