php - CodeIgniter - Message: mkdir(): Permission denied on Ubuntu -
i'd please. have php script inside post_model constructor
$dir = fcpath . 'uploads' . directory_separator . 'posts'; if (!is_dir($dir)) { mkdir($dir, 0755, true); }
which shows me error:
severity: warning message: mkdir(): permission denied
the main idea project has ability create users , these users can upload images, or create folders-albums stored in uploads folder.
i've been struggling fix error last days , can't find solution. have tried code , on windows , works great, not on linux (ubuntu 14.04)
even had same problem , tried umask, worked. can this,
$old = umask(0); mkdir($dir, 0755, true); umask($old);
Comments
Post a Comment