【问题标题】:Assign read & write file permission to a specific user for a specific file using php使用php为特定文件的特定用户分配读写文件权限
【发布时间】:2017-02-15 06:09:45
【问题描述】:

我想更改特定用户对特定文件的文件权限。 所有这些事情都需要通过php来完成。 我正在使用chmod(file_path, 0644)。 但它不起作用。

请提出建议。

【问题讨论】:

    标签: php macos unix permissions chmod


    【解决方案1】:

    缺少“$”?

    chmod($file_path, 0644)

    或没有权限,因为不是 $file_path 的所有者(apache-php 作为用户 wwwrun 运行)

    【讨论】:

    • 没关系。我刚刚添加了 file_path 用于演示目的。你知道如何在php中更改其他用户的文件权限吗?
    猜你喜欢
    • 1970-01-01
    • 2016-10-15
    • 2019-11-15
    • 2023-03-29
    • 2012-02-04
    • 2021-02-24
    • 2017-06-27
    • 1970-01-01
    • 2021-07-29
    相关资源
    最近更新 更多