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.

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

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型