doubu1950 2012-03-04 19:07
浏览 382
已采纳

include():无法打开流:没有这样的文件或目录

This might just come as a very silly question, but i am really frustrated of this not working. I have a home file (home.php) which has contains <? include ("/production/fetch_order.php"); ?>. As it can be seen i am trying to access a file from home.php. The file is named as fetch_order.php which is in the production folder. My path is correct, the spellings are absolutely correct too. However i end up with this error:

Warning: include(/production/fetch_order.php) [function.include]: 
failed to open stream: No such file or directory in /path/to/home.php on line 119

Warning: include() [function.include]: Failed opening '/production/fetch_order.php'
for inclusion (include_path='.:/path/to/php/php5.3.6/lib/php') in
/path/to/home.php on line 119
  • 写回答

3条回答 默认 最新

  • dongtaogou6226 2012-03-04 19:11
    关注

    You are using an absolute path (/) at the start of the line, you need to remove that slash and it would be a relative path, example:

    production/fetch_order.php
    

    When adding a slash, it starts at the root directory of your system, without it, it looks in the current directory.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于温度改变石墨烯介电性能(关键词-介电常数)
  • ¥150 HDMI分路器LT86102 的输出在890MHz频点处EMC超标8DB
  • ¥15 druid(相关搜索:数据库|防火墙)
  • ¥15 大一python作业
  • ¥15 preLaunchTask"C/C++: aarch64- apple-darwin22-g++-14 生成活动 文件”已终止,退出代码为-1。
  • ¥60 如何鉴定微信小程序数据被篡改过
  • ¥18 关于#贝叶斯概率#的问题:这篇文章中利用em算法求出了对数似然值作为概率表参数,然后进行概率表计算,这个概率表是怎样计算的呀
  • ¥20 C#上传XML格式数据
  • ¥15 elementui上传结合oss接口断点续传,现在只差停止上传和继续上传,各大精英看下
  • ¥20 手机截图相片分辨率降低一半