php使用 set_include_path
通过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的更多相关文章
- set_include_path详细解释
zendframework的示例index.php里有这样一句 set_include_path('.' . PATH_SEPARATOR . '../library/'. PATH_SEPARATO ...
- set_include_path — 设置 include_path 配置选项为当前脚本设置 include_path 运行时的配置选项。
说明 string set_include_path ( string $new_include_path ) 为当前脚本设置 include_path 运行时的配置选项. 参数 new_includ ...
- php set_include_path
string set_include_path ( string $new_include_path ) 为当前脚本设置 include_path 运行时的配置选项. Example #2 添加到in ...
- set_include_path()的用法
朋友们 开发的时候 ,总会 遇到 include_once()的情况.有时候,我们需要大量的引用文件,但是被引用文件的路径有时候是个问题. 我们可以把 经常要引用 的文件,放在一个 文件夹中,我们取 ...
- php 文件路径设置 set_include_path(); get_include_path();
<?php set_include_path($string); //设置路径 get_include_path(); // 获取当前的路径 //例如:文件路径为: //D:/phpweb/de ...
- set_include_path和get_include_path用法详解
首先set_include_path这个函数呢,是在脚本里动态地对PHP.ini中include_path进行修改的.而这个include_path呢,它可以针对下面的include和require的 ...
- 012PHP文件处理——copy rename file set_include_path
<?php //copy rename file set_include_path /*file() 以行为单位返回数组 * */ /*$arr=file('b.txt'); foreach ( ...
- 【php】set_include_path和get_include_path用法详解
目的:在框架中方便加载文件 参考:http://blog.sina.com.cn/s/blog_4ce89f200100twbl.html 如果我们没有设置这个值,可能我们需要写一些完全的路径: ...
- Php函数set_include_path()函数详解
set_include_path--设置include_path配置选项. 说明 string set_include_path(string $new_include_path); 为当前脚本设置i ...
随机推荐
- 企业Openvpn环境部署
企业Openvpn环境部署 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任 ...
- yii中sphinx索引配置解析
#MySQL数据源配置,详情请查看:http://www.coreseek.cn/products-install/mysql/#请先将var/test/documents.sql导入数据库,并配置好 ...
- PHP浮点数的一个常见问题的解答 (转载 http://www.laruence.com/2013/03/26/2884.html)
不过, 我当时遗漏了一点, 也就是对于如下的这个常见问题的回答: <?php $f = 0.58; var_dump(intval($f * 100)); //为啥输出57 ?> 为啥输出 ...
- 词频统计-------------web版本
要求:把程序迁移到web平台,通过用户上传TXT的方式接收文件.建议(但不强制要求)保留并维护Console版本,有利于测试. 在页面上设置上传的控件,然后在servlet中接受,得到的是一个字节流, ...
- mysql笔记01 MySQL架构与历史、Schema与数据类型优化
MySQL架构与历史 1. MySQL架构推荐参考:http://www.cnblogs.com/baochuan/archive/2012/03/15/2397536.html 2. MySQL会解 ...
- 匹配 prev 元素之后的所有 siblings 元素
描述: 找到所有与表单同辈的 input 元素 HTML 代码: <form> <label>Name:</label> <input name=" ...
- 爱普生 RS330 打印机墨水连供装置墨盒吸墨复位方法
芯片复位方法: 先按充墨键(墨水灯按键),一下一下按,把墨车按停到右侧换墨盒的位置为止(就是右侧框框正中位置), 全程带电操作,停到换墨盒的位置后再按住芯片复位键(墨盒芯片上面白色的小按键)5秒以上再 ...
- 有趣的insert死锁
昨天看到一个很有意思的死锁,拿来记录下: 环境:deadlock on 事务隔离级别: read commited 表结构: root::>show create table lingluo\G ...
- linux之V4L2摄像头应用流程【转】
本文转载自:http://blog.csdn.net/tommy_wxie/article/details/11486907 对于v4l2,上次是在调试收音机驱动的时候用过,其他也就只是用i2c配置一 ...
- linux下配置环境变量【原创】
用户目录下的.profile, 你只需要在用户目录下,创建bin目录,在里面放入你想要执行的可执行文件,就可以在命令行下就可以使用了 # ~/.profile: executed by the com ...