0

I use the Mkdir function of symfony2 filesystem's class. The doc (http://symfony.com/fr/doc/2.3/components/filesystem.html#mkdir) says that the directory must be created with 777 permission by default.

But when I use this function in my command, the directory is well created but with 755 permission. I launch my command in root...

What is the problem ?

Think's and sorry for my bad english

Fabien
  • 548
  • 7
  • 18
  • I have found the response to my question here : http://stackoverflow.com/questions/3997641/why-cant-php-create-a-directory-with-777-permissions – Fabien Dec 29 '13 at 16:45

2 Answers2

1

add umask(0000); in your app_dev.php or app.php file.

Make sure that you have specified the right directory owner in your cas www-data

enjoy !!

CodeIsLife
  • 1,205
  • 8
  • 14
0

Just pass in the permissions as the first argument to the mkdir function

->mkdir('/some/directory', 0777);
Ohgodwhy
  • 49,779
  • 11
  • 80
  • 110
  • Same result, I have also tried to add this line after mkdir but without success : $fs->chmod($this->upload_root_dir.'/'.$args['identifier'],0777,true); – Fabien Dec 29 '13 at 14:26