开发者

PHP > mkdir path issues

开发者 https://www.devze.com 2023-02-08 02:16 出处:网络
I\'m currently working on a website admin panel, I added a form that adds clients to the database, what I want to d开发者_如何转开发o now, is to create folders for them via PHP.

I'm currently working on a website admin panel, I added a form that adds clients to the database, what I want to d开发者_如何转开发o 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).


Probably you are not the owner of files/directories created by PHP script.

0

精彩评论

暂无评论...
验证码 换一张
取 消