dongma6326 2010-06-12 02:41
浏览 58

Same-directory包含使用PHP在Fedora服务器上失败

I have a couple files that look like this:

index.php:

<?php  
include('includes/header.php');

...

includes/header.php:

<?php
include('config.php');

...

The error I get is

Warning: require(config.php) [function.require]: failed to open stream: No such file or directory in [dir]/includes/header.php on line 2
Fatal error: require() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/share/pear:/usr/share/php') in [dir]/includes/header.php on line 2

I did some further debugging: when I add the call

system('pwd');

to includes/header.php, it shows [dir], where it should say [dir]/includes. Adding the 'includes/' to the include path works, but isn't desirable because that would fail on the production server.

The above code works on a production server, and worked fine on my development Fedora server, until I tried to change my development environment so that the Fedora server's document root is a mounted CIFS share.

Any ideas? Thanks.

  • 写回答

3条回答 默认 最新

  • drphfy1198 2010-06-12 02:49
    关注

    worked fine ... until I tried to change my development environment so that the Fedora server's document root is a mounted CIFS share.

    Is SELinux enabled?

    Check /var/log/audit/audit.log

    I'm going to wager that SELinux is enabled and in enforcing mode, and is interfering.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看