php mkdir via symlink warning

I want to make directory recursively by use of symlinks (softlinks) but I encouter with warning :
Warning: mkdir(): File exists in …Path to php code… on line 21
The main directory want to create is /vagrant/resources/page.
In the /var/www path I create a symlink named “resources” that links to /vagrant/resources directory and the php code is like below:

$directory = '/var/www/resources/page';
if(!file_exists($directory)){
      mkdir($directory,0777,true);
}

The permissions to all directories inside /vagrant is set to 777.
Thanks.


Source: php

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.