首页 > 开发 > PHP > 正文

Codeigniter中mkdir创建目录遇到权限问题和解决方法

2024-05-04 22:19:38
字体:
来源:转载
供稿:网友

今天在用 Codeigniter 上传文件时(部署在 Centos),提示如下错误:

A problem was encountered while attempting to move the uploaded file to the final destination.

相关代码:

代码如下:
//目录检测
if (!is_dir($cache_path)) mkdir($cache_path, '777');

修改为如下代码既解决问题:

代码如下:
//目录检测
if (!is_dir($cache_path)) mkdir($cache_path, 0777);

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表