Fabien
Fabien

Reputation: 548

Permissions issues on Symfony2 filesystem with mkdir function

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

Upvotes: 0

Views: 1813

Answers (2)

CodeIsLife
CodeIsLife

Reputation: 1255

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 !!

Upvotes: 1

Ohgodwhy
Ohgodwhy

Reputation: 50797

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

->mkdir('/some/directory', 0777);

Upvotes: 0

Related Questions