CodeIgniter - 消息:mkdir():在Ubuntu上拒绝权限 [英] CodeIgniter - Message: mkdir(): Permission denied on Ubuntu

查看:505
本文介绍了CodeIgniter - 消息:mkdir():在Ubuntu上拒绝权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一些帮助。我在我的Post_model构造函数中有这个PHP脚本

I'd like some help please. I have this PHP script inside my Post_model constructor

$dir = FCPATH . 'uploads' . DIRECTORY_SEPARATOR . 'posts'; 
if (!is_dir($dir)) {
    mkdir($dir, 0755, true);
} 

显示此错误:

Severity: Warning

Message: mkdir(): Permission denied

主要思想是项目能够创建用户,这些用户可以上传图片,或创建存储在uploads文件夹中的文件夹 - 相册。

The main idea is that the project has the ability to create users and these users can upload images, or create folders-albums which are stored in the uploads folder.

我一直在努力解决这个错误的最后几天,找不到一个解决方案。我试过这个代码,在Windows和工作伟大,但不是在Linux(Ubuntu 14.04)

I've been struggling to fix this error the last days and can't find a solution. I have tried this code and on Windows and works great, but not on Linux (Ubuntu 14.04)

推荐答案

在PHP / CodeIgniter中创建目录]
http://codedpoint.16mb.com/index.php/viewCode?topic=Create%20Directory%20-%20CodeIgnitor

[How to Create Directory in PHP / CodeIgniter] (http://codedpoint.16mb.com/index.php/viewCode?topic=Create%20Directory%20-%20CodeIgnitor)

这篇关于CodeIgniter - 消息:mkdir():在Ubuntu上拒绝权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆