mkdir() in php is setting folder permission to 755 But I Need 777?

Rickstar picture Rickstar · Nov 9, 2010 · Viewed 19.3k times · Source

I am trying to create a folder on my server using php when i set it to 0777 it comes out as 755?

mkdir($create_path, 0777);

Thank you

Answer

pt2ph8 picture pt2ph8 · Nov 9, 2010

Try this:

$old_umask = umask(0);
mkdir($create_path, 0777);
umask($old_umask);

http://php.net/umask