I'm currently working on a website admin panel, I added a form that adds clients to the database, what I want to do now, is to create folders for them via PHP.
So I tried to do that using the function: mkdir(), The problem is, that when I tested the function on my "Xampp" server, it all worked just as i wanted it to.
But when I moved the file to the real host that I will use via FTP, and It just wont work the same..
ill try to explain whats wrong..:
mkdir('folderName'); //this will create a folder that i cant access through the FTP
mkdir('folderName', 0777); //creates a folder that i can access, but cant open other folders in it and cant change chmod permissions
I also need to create some nested folders for example:
mkdir('folderName/anotherFolder',0777,true); //this works on the host but again, the folders are not letting me change chmod permissions and cant create folders in them
in my xampp server i could create a few folders in a given path for example:
mkdir('folderName');
mkdir('folderName/one');
mkdir('folderName/two');
the above examples arent working on my host..
So yea sorry for writing so much, I just thought that you guys need to know those things.. Anyways, thanks in advance!
Try chgrp
as well as chmod
.
Other than that, the best solution in such ostensible FS situations is to do it via FTP. Major frameworks do this (including Joomla and Wordpress).