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 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?