PHP 不在根目录的页面文件 include 其他不在根目录文件
来源:互联网 发布:商品数据库张国良 编辑:程序博客网 时间:2024/05/21 11:03
基本是这个错误
我的根目录文件结构
..
/conn/conn.php
/test.test.php
test.php有
include("/conn/conn.php") 这句话
Warning: include(./conn/conn.php) [function.include]: failed to open stream: No such file or directory in D:\Program Files (x86)\AppServ\www\html4\mobile\setting_skins_mobile.php on line 1
Warning: include() [function.include]: Failed opening './conn/conn.php' for inclusion (include_path='.;C:\php5\pear') in D:\Program Files (x86)\AppServ\www\html4\mobile\setting_skins_mobile.php on line 1
无记录!
解决方法
include("../conn/conn.php") 但是不能使用你的工程的文件夹名字代替".."
参考 http://www.codingforums.com/showthread.php?t=170962
If you have gone up a level and are referencing items down a level in the directory structure you will need to let PHP know this, by preceeding your file paths with "../" Here is an example:
Assume you have the following files:
afile.php
and
directory/myfile.php
if you want directory/myfile.php to include afile.php you will need to do the following:
include('../afile.php');
include('./afile.php');
- PHP 不在根目录的页面文件 include 其他不在根目录文件
- C#执行批处理,当批处理不在程序根目录时,出现“找不到文件”的问题的解决方法
- 项目文件不在apache根目录下怎么可以访问到呢?
- 包含文件#include file相对文件路径和#include virtual相对根目录路径的区别
- php在网站根目录下写文件
- jsp不在根目录下面,struts2 action访问不到怎么办 ,解决办法
- asp.net 首页不在根目录下怎么配置
- 不在 sudoers 文件中~~
- ndroid平台根目录文件
- Android平台根目录文件
- wordpress根目录文件分析
- Android平台根目录文件
- Android 平台根目录文件
- Android平台根目录文件
- Android平台根目录文件
- Android平台根目录文件
- Android平台根目录文件
- linux根目录文件作用
- Android工程的自动创建,编译并生成apk
- LR中的参数设置和场景虚拟用户的关联(Unique + each iteration | each occurence | once)
- iPhone开发基础教程笔记(一)--第一章和第二章-创建基本项目
- nginx优化配置
- man 3 printf fprintf sprintf
- PHP 不在根目录的页面文件 include 其他不在根目录文件
- OS5中 UIViewController的parentViewController属性发生了改变
- 设计模式_前言
- 前台页面以url形式向后台传递数组
- nginx开启监控模块
- (转) iCloud Storage 详细的官方文档
- (转)iOS6和Xcode4.5初体验-图多杀猫
- 跟“一闪而过”说再见
- Oracle 导入导出表