Home>

css.php

private function getHistory ()
    {
        $css_history = array ();
        $dir = Config :: get ('base_site_dir'). Config :: get ('■■■■'). '/'. $this->data ['■■■■'] ['■■■■ '];
        if (! file_exists ($dir)) {
            // create if there is no directory
         var_dump ($dir);
    mkdir ($dir, 0777, true);
        }


Contents of variable $dir

string (80) "/ Applications/XAMPP/xamppfiles/htdocs/■■■■/■■■■/css/"


If i access it with mkdir (): Permission denied (access denied).
The permissions of the directory are
Myself: read/write,
staff: reading/writing,
everyone: read/write,
What are the possible causes of access denial?

If mkdir ($dir, 0777, true);is set to mkdir ($dir) ;, mkdir (): No such file or directory, so
Is/ not loaded?
Can anyone tell me? Thanking you in advance.

drwxrwxrwx 3 ■■■■ staff 96 8 22 11:50  (directory)
environment
XAMPP
macOS
phpstorm
php
  • Answer # 1

      

    Directory ★★★★ permissions are

    ? Are you trying to make it because it doesn't exist?

    /Applications/XAMPP/xamppfiles/htdocs/■■■■/■■■■/css/★★★★
    Please check the existence and access right of the path name in the middle of.

    /Applications/XAMPP/xamppfiles/htdocs/■■■■/exists but/Applications/XAMPP/xamppfiles/htdocs/■■■■/■■■■ If/does not exist, write permission is required for/Applications/XAMPP/xamppfiles/htdocs/■■■■/.

  • Answer # 2

    If you have r permission in a directory but do not have x permission, you cannot list the files in that directory by ls.

    If it is as described, the target directory's permission is 666 (drw-rw-rw).
    755 (drwxr-xr-x)

    Try what happens.

    x You also have authority, so let's simplify things.

    /usr/home/hogehoge


    <? php
    $dir = './work';
    if (! file_exists ($dir))
    {
        var_dump ($dir);
        mkdir ($dir, 0777, true);
    }
    ?>


    I tried to create and run.

    $ls
    $php source file name.php
    string (6)"./ work"
    $ls
    work


    have become.
    The environment is FreeBSD, but basically MacOS and FreeBSD should be the same.
    Then, as OTN says, is there a problem somewhere in the directory path?