Home > Backend Development > PHP Tutorial > Codeigniter中mkdir创建目录遇到权限问题和解决方法_php实例

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

WBOY
Release: 2016-06-07 17:17:09
Original
979 people have browsed it

今天在用 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);
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template