I have this PHP script inside my Post_model constructor:
PHP Code:
$dir = FCPATH . 'uploads' . DIRECTORY_SEPARATOR . 'posts';
if (!is_dir($dir)) {
mkdir($dir, 755, true);
}
which shows me this error:
Code:
Severity: Warning
Message: mkdir(): Permission denied
and can't create the posts folder in order to upload images. If I comment this code and create the uploads/posts folder manually and then try to upload a file, the upload library shows my an error saying that the folder is not writable. How can I fix this error ?