php中的路径问题与set_include_path
来源:互联网 发布:java资深工程师面试题 编辑:程序博客网 时间:2024/05/16 10:39
first:
php中常用的路径
当前文件路径:D:\phpweb\php_example\include_path.php
1.dirname(__FILE__); //输出D:\phpweb\php_example
2.$_SERVER['SCRIPT_FILENAME']; //输出D:/phpweb/php_example/include_path.php
second:
php中的set_include_path
在php中,include文件时,当包含路径不为相对也不为绝对时(如:include("example.php")),会先查找include_path所设置的目录,然后再在当前目录查找,这也是为什么很多资料上提到include("./example.php")比include("example.php")效率高的原因。
方法:
1.ini_set("include_path", "/usr/lib/pear"); //所有版本 2.set_include_path("/usr/lib/pear"); //version>=4.3.0
可以用下面的方法,在原有目录上添加目录
<?php
$path = '/usr/lib/pear';set_include_path(get_include_path() . PATH_SEPARATOR . $path);//设置后的include_path变为类似/usr/lib/function;/usr/lib/pear ?>
欢迎交流,我是luluyrt@163.com
0 0
- php中的路径问题与set_include_path
- php的set_include_path与get_include_path()的用法
- php中的路径问题
- php的set_include_path函数
- PHP的set_include_path函数
- PHP 函数: set_include_path
- PHP中set_include_path
- 关于PHP中的路径问题
- 关于PHP中的路径问题
- set_include_path()与get_include_path()
- 关于PHP的set_include_path()函数
- php函数set_include_path()用法详解
- php&javascript 中的 绝对路径与相对路径
- php中set_include_path函数的用法
- php手记-set_include_path和get_include_path用法详解
- PHP--set_include_path和get_include_path用法详解
- PHP中set_include_path()函数相关用法分析
- PHP框架优化之-set_include_path函数
- 信息化:是救星还是瓶颈?
- 多组数据之亲和数
- hdu1057(贪心)
- Web测试要点(功能、性能、可用性、兼容、安全)
- NYOJ 311 完全背包
- php中的路径问题与set_include_path
- 突破select的FD_SETSIZE限制
- Ant简介
- GridView 最后一个输入值得不到
- 头文件pthread.h
- 软件测试术语
- 从一道面试题分析Thread.interrupt方法
- 黑马程序员-01-java环境搭建
- CentOS将用户添加到sudoer列表