Home > Backend Development > PHP Tutorial > 用开源startbbs 遇到mkdir(): Permission denied的错误提示

用开源startbbs 遇到mkdir(): Permission denied的错误提示

WBOY
Release: 2016-06-06 20:36:33
Original
1140 people have browsed it

rt。

提示错误行是

<code>php</code><code>mkdir($this->path,0777,true);
</code>
Copy after login
Copy after login

是否是因为我的apache执行php 函数mkdir()权限不够,我应该如何修改?

回复内容:

rt。

提示错误行是

<code>php</code><code>mkdir($this->path,0777,true);
</code>
Copy after login
Copy after login

是否是因为我的apache执行php 函数mkdir()权限不够,我应该如何修改?

不考虑安全性的话,一个简单粗暴的答案就是如Lucups所说:

<code>shell</code><code>cd /path/to/your/webroot
sudo chmod -R 777 your_dir
</code>
Copy after login

考虑安全性的话,
apache+php创建文件夹的默认属主是webserver的用户(apache),
只需要把网站目录属主改为apache就行了。

<code>chown apache:apache -R your_dir
</code>
Copy after login

设置你的Web目录权限即可。

<code>cd /path/to/your/webroot
sudo chmod -R 777 your_dir
</code>
Copy after login
Related labels:
php
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