0

我正在尝试创建一个文件夹 chmod 它到 777 但我无法做到。它总是将更改还原为:

File Permissions: 341 Owner/Group: 48 48

仅当我尝试使用 PHP 创建文件夹时才会发生这种情况。我使用 Laravel 的 mkdir 函数。(参考: http: //laravel.com/api/class-Laravel.File.html)如果我使用 FTP 创建文件夹,它可以正常工作。

正如在其他(可能是重复的)主题上询问的那样;

该脚本输出:

<?php echo "UID = " . getmyuid() . ", User = " . get_current_user(); ?>
//Output: UID = 502, User = TestUser

我使用 directadmin 作为面板和safe_mode is off.

我应该怎么办?

4

1 回答 1

1

在您的 httpd.conf 文件中,将这两行更改为您想要的任何用户和组。

# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch...
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User _www
Group _www

然后通过键入在 linux 系统上重新启动您的 apache;

sudo /usr/sbin/apachectl 重启

在我不知道的窗户上。

于 2013-04-16T18:40:54.597 回答