PHP脚本中include文件出错解决方法

yipeiwu_com6年前PHP代码库
1. 出现“未找到文件“类似的错误时候,检查include文件的位置是否正确,下面引用php手册页面的原话:
Files for including are first looked in include_path relative to the current working directory and then in the directory of the current script. E.g. if your include_path is libraries, current working directory is /www/, you included include/a.php and there is include "b.php" in that file, b.php is first looked in /www/libraries/ and then in /www/include/. If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory.
2. 当出现permission deny 类似错误的时候,按以下方法排除
a) 检测被包含的文件读权限是否打开
b) 检测被包含的文件路径上的每个目录的x权限是否打开,该权限决定了目录能否被浏览。

相关文章

百度工程师讲PHP函数的实现原理及性能分析(三)

常用php函数实现及介绍 count count是我们经常用到的一个函数,其功能是返回一个数组的长度。 count这个函数,其复杂度是多少呢? 一种常见的说法是count函数会遍历整个数...

浅谈php(codeigniter)安全性注意事项

1、httponly session一定要用httponly的否则可能被xxs攻击,利用js获取cookie的session_id。 要用框架的ci_session,更长的位数,http...

比较strtr, str_replace和preg_replace三个函数的效率

之前已经分析过strtr的源码了,现在就比较strtr, str_replace和preg_replace的效率:复制代码 代码如下:$str = '111111110000000000...

php文件上传 你真的掌握了吗

php文件上传 你真的掌握了吗

这里首先声明一下这一章的内容比较多,比较难,你要抱着和自己死磕的态度。细微之处不放过,多敲多练是王道。 学习就像爬山,得一步一步来,首先给自己定一个小目标,然后再坚持不懈地往高出攀爬,...

PHP封装的完整分页类示例

本文实例讲述了PHP封装的完整分页类。分享给大家供大家参考,具体如下: <?php class pageclass{ private $total; //总记...