PHP,功能的mkdir()许可被拒绝 [英] Php, Function mkdir() permission denied

查看:535
本文介绍了PHP,功能的mkdir()许可被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想PHP来创建一个可以存储图像的用户的文件夹。因此,当有人成功地创建一个帐户目录中的图片文件夹中创建。我使用了PHP的mkdir函数来创建目录,但我得到一个错误说权限被拒绝。做一些研究,我意识到我需要编辑htaccess文件赋予权限,以创建一个目录。有人可以给上如何做到这一点的链接或教程?

I want php to create a folder that can store images for a user. So when someone succesfully creates an account a directory is created in the Images folder. I used the php mkdir function to create the directory, but i get an error saying permission denied. Doing some research i realized i need to edit the htaccess file to give permission to create a directory. Can someone give a link or tutorial on how to do this?

TLDR:我有使用Apache一个GoDaddy的服务器上的网站。可有人指导我在正确的方向,当涉及到编辑htaccess文件给予准许的PHP创建一个目录?

TLDR:I have a website on a godaddy server using Apache. Can someone guide me in right direction when it comes to editing the htaccess file to give permission for php to create a directory?

感谢您,

推荐答案

给目标目录的父足够的权限。

Give the target dir's parent adequate permissions.

例如,如果你想创建一个目录的 /程序/上传/用户名/ 确保 /程序/上传/ 有权限。

For example, if you are trying to create a dir at /app/uploads/username/ Make sure /app/uploads/ has permission.

登录到您的FTP,右键单击 /上传/ ,更改权限777分之755。

Login into your FTP, right click /uploads/, change permissions to 755/777.

这篇关于PHP,功能的mkdir()许可被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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