mkdir() not working

前端 未结 8 2177
日久生厌
日久生厌 2021-02-19 23:08

My code

mkdir(\"/some/absolute/path\",0777);

and

mkdir(\"relative/path\", 0777);

is not working, safe mode is

8条回答
  •  悲哀的现实
    2021-02-19 23:18

    For future references, the problem might come from the possibility that the directory where you're trying to create your new directory doesn't have enough permission.

    For instance, your index directory might look like this: index.php new_dirs_here

    if new_dirs_here doesn't have enough permission then you can't create direcories inside.

    To solve this, I'd use the command: chmod 777 new_dirs_here

    I'm not worrying about security now, Just trying to solve the immediate problem. You could of course look up a better permission settings, but the idea is that your new_dirs_here should have enough permissions.

    Then, your mkdir() dunction should work just fine.

    Good luck

提交回复
热议问题