通过set_include_path引用home/lib/image.func.php

1.创建include.php

2.添加如下代码

3.在需要引用的文件中包含include.php文件

<?php
session_start();
define("ROOT", dirname(__FILE__));
set_include_path(".".PATH_SEPARATOR.ROOT."/lib".PATH_SEPARATOR.ROOT."/core".PATH_SEPARATOR.get_include_path());
require_once'mysql.func.php';
require_once'image.func.php';
require_once'common.func.php';
require_once'image.func.php';
?>

  

包含inclde.php 文件后无法正常运行

原因是因为两次使用了session_start();

php使用 set_include_path的更多相关文章

  1. set_include_path详细解释

    zendframework的示例index.php里有这样一句 set_include_path('.' . PATH_SEPARATOR . '../library/'. PATH_SEPARATO ...

  2. set_include_path — 设置 include_path 配置选项为当前脚本设置 include_path 运行时的配置选项。

    说明 string set_include_path ( string $new_include_path ) 为当前脚本设置 include_path 运行时的配置选项. 参数 new_includ ...

  3. php set_include_path

    string set_include_path ( string $new_include_path ) 为当前脚本设置 include_path 运行时的配置选项. Example #2 添加到in ...

  4. set_include_path()的用法

    朋友们 开发的时候 ,总会 遇到 include_once()的情况.有时候,我们需要大量的引用文件,但是被引用文件的路径有时候是个问题.  我们可以把 经常要引用 的文件,放在一个 文件夹中,我们取 ...

  5. php 文件路径设置 set_include_path(); get_include_path();

    <?php set_include_path($string); //设置路径 get_include_path(); // 获取当前的路径 //例如:文件路径为: //D:/phpweb/de ...

  6. set_include_path和get_include_path用法详解

    首先set_include_path这个函数呢,是在脚本里动态地对PHP.ini中include_path进行修改的.而这个include_path呢,它可以针对下面的include和require的 ...

  7. 012PHP文件处理——copy rename file set_include_path

    <?php //copy rename file set_include_path /*file() 以行为单位返回数组 * */ /*$arr=file('b.txt'); foreach ( ...

  8. 【php】set_include_path和get_include_path用法详解

    目的:在框架中方便加载文件 参考:http://blog.sina.com.cn/s/blog_4ce89f200100twbl.html 如果我们没有设置这个值,可能我们需要写一些完全的路径:    ...

  9. Php函数set_include_path()函数详解

    set_include_path--设置include_path配置选项. 说明 string set_include_path(string $new_include_path); 为当前脚本设置i ...

随机推荐

  1. 多边形和圆的相交面积(模板)hdu2892、hdu4404

    area Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  2. 【Origin】 碑铭

    快意人生潇洒过, 飘渺岁月不留痕: 他朝墓穴成青冢, 宁不留名念此生. -作于二零一五年六月十日

  3. linux扩大swap交换空间

    有两种解决方法:一是创建新的swap分区;另一则是创建swap文件 创建swap文件如果你的硬盘空间已经全部分配给其他分区,也没有多余的预算新添购硬盘,我们可以利用swap文件的方式增加虚拟的swap ...

  4. android adb shell

    http://blog.csdn.net/zyp009/article/details/8332925 最快的Android模拟器Genymotion的安装与使用 http://blog.csdn.n ...

  5. linux tomcat 配置

    http://www.cnblogs.com/xdp-gacl/p/4097608.html

  6. PHP浮点数的一个常见问题的解答 (转载 http://www.laruence.com/2013/03/26/2884.html)

    不过, 我当时遗漏了一点, 也就是对于如下的这个常见问题的回答: <?php $f = 0.58; var_dump(intval($f * 100)); //为啥输出57 ?> 为啥输出 ...

  7. SQL Server数据库性能优化(一)之 优化SQL 语句

    最近工作上基本没什么需求(好吧 不是最近是好久了,所以随便看看基础的东西来填补自己的空白) 原文出自:http://www.blogjava.net/allen-zhe/archive/2010/07 ...

  8. java 控制器向页面传值方式

    1.单个字符串 @RequestMapping(value = "list", method = RequestMethod.GET) public ModelAndView li ...

  9. 响应式框架pure--来自雅虎

    梦想还是要有  http://www.purecss.org/ 

  10. 《zw版·delphi与halcon系列原创教程》hello,zw

    <zw版·delphi与halcon系列原创教程>hello,zw 按惯例,第一个程序是‘hello’ 毕竟,Halcon是专业的图像库,所以我们就不用纯文本版的,来一个专业版.Halco ...