Apache权限,在Arch Lamp Setup上创建PHP文件

时间:2013-06-13 10:07:58

标签: php apache file-permissions archlinux

似乎我无法在Arch Linux Lamp Setup中上传和创建文件。当我检查我想要的文件夹权限时,我得到:

ls -ldh thumbnails/
drwxrwxrwx 5 ytsejam http 4.0K Jun 13 12:33 thumbnails/

我通过php whoami()结果检查我的apache用户是“http” 和/ etc / group有这些条目

http:x:33:ytsejam
users:x:100:http
wheel:x:10:root,ytsejam.

我无法在/var/log/httpd/error_log或access_log上看到任何错误。 上传文件时出现错误

ErrorException

file_put_contents(/home/ytsejam/public_html/projemiz/public/uploads/img/posts/thumbnails/213/thumb-flam1.jpg): failed to open stream: No such file or directory

当我手动创建文件夹时,我可以在上传时获得成功。这是一个权限错误,但我不知道如何解决它。任何帮助?

1 个答案:

答案 0 :(得分:1)

无法使用file_put_contents创建目录(文件夹)。

请参阅PHP, Creating a folder when I run file_put_contents()