douzhong6480 2014-07-16 18:24
浏览 48
已采纳

我如何知道我的php进程是否具有写入文件的正确权限?

I turned on error logging in php.ini file.

error_log `/etc/httpd/logs/error_log`

error_reporting `22527`

I try triggering an error by using trigger_error() function. However, nothing gets written to the file. File is not even created. I'm guessing there are permission errors but how can I tell?

  • 写回答

1条回答 默认 最新

  • dongna1593 2014-07-16 18:28
    关注

    http://php.net/manual/en/function.is-writable.php

    bool is_writable ( string $filename )
    

    returns TRUE if the filename exists and is writable.

    That being said, logs generally go in /var/log/ or /var/apache2/log or somewhere other than /etc/ as

    /etc

    This is the nerve center of your system, it contains all system related configuration files in here or in its sub-directories

    If you mess something up in /etc/ it will be really, really bad.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端