我目前正在开发一个网站管理面板,我添加了一个将客户端添加到数据库的表单,我现在想要做的是通过 PHP 为它们创建文件夹。
所以我尝试使用以下函数来做到这一点:mkdir(),问题是,当我在我的“Xampp”服务器上测试该函数时,一切都如我所愿。
但是当我将文件移动到我将通过 FTP 使用的真实主机时,它就不会像以前那样工作了..
生病试图解释什么是错的..:
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
我还需要创建一些嵌套文件夹,例如:
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
在我的 xampp 服务器中,我可以在给定路径中创建一些文件夹,例如:
mkdir('folderName');
mkdir('folderName/one');
mkdir('folderName/two');
以上示例不适用于我的主机..
所以是的,很抱歉写了这么多,我只是觉得你们需要知道这些事情。无论如何,提前谢谢!