dongtou5557 2015-07-29 15:37
浏览 33
已采纳

需要一个目录而不是一个文件?

I got this php error message:

Warning: require(/home/victor/public_html/plugindev/wp-includes/plugin.php): failed to open stream: Not a directory in /home/victor/public_html/plugindev/wp-settings.php on line 75

Fatal error: require(): Failed opening required '/home/victor/public_html/plugindev/wp-includes/plugin.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/victor/public_html/plugindev/wp-settings.php on line 75

but...:

 ~  stat /home/victor/public_html/plugindev/wp-includes/plugin.php 
File: ‘/home/victor/public_html/plugindev/wp-includes/plugin.php’
➜  ~  stat /home/victor/public_html/plugindev/wp-settings.php
File: ‘/home/victor/public_html/plugindev/wp-settings.php’

and the most strange part, the occurs randomly and at randomly files and all exists. (ie already seen the same error for other files)

I think is is a incompatiblity with plugin I'm developing but doesn't know how to debug

  • 写回答

1条回答 默认 最新

  • dongluyi5123 2015-07-29 16:34
    关注

    There is clearly a permissions problem here.

    <?php
    $dir = '/path/to/dir';
    $file = $dir . '/file.ext';
    
    echo is_readable($dir)
        ? "Dir is readable"
        : "Dir is not readable";
    
    echo is_readable($file)
        ? "File is readable"
        : "File is not readable";
    

    That snippet of code will tell you if there is a permissions issue and you can resolve the code appropriately. If it is 'random' then its possible that you are expecting files to be present when they have not been generated yet? If that is the case, the checking code above can be used to dictate if a file needs to be created.

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

报告相同问题?

悬赏问题

  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)
  • ¥66 比特币地址如何生成taproot地址
  • ¥20 数学建模数学建模需要
  • ¥15 关于#lua#的问题,请各位专家解答!
  • ¥15 什么设备可以研究OFDM的60GHz毫米波信道模型
  • ¥15 不知道是该怎么引用多个函数片段
  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 基于pso参数优化的LightGBM分类模型