How to let php get mkdir() access?

Issue

This Content is from Stack Overflow. Question asked by Uday Bhargav

I have a piece of code as follows in php

$success = mkdir($dir, 0777, true);
if ($success === false) {
    $this->warn("Failed creating target directory [$dir]. Closing appender.");
    $this->closed = true;
    return false;
                }

When I run this I get an error

mkdir(): Permission denied in /<mypath>

How do I give access to mkdir(). I am running macOS 12(MOnterrey)



Solution

Check the Answers

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?