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通过session id 实现session共享和登录验证的代码

先说说,这个机制的用途吧,到现在为止战地知道这个机制有两个方面的用途: 首先,多服务器共享session问题,这个大家应该都能够理解的,当一个网站的用户量过大,就会使用服务器集群,例如专...

php去除字符串中空字符的常用方法小结

本文实例总结了php去除字符串中空字符的常用方法。分享给大家供大家参考。具体分析如下: php中包含四个可以去除字符串空格的函数: trim() – 去除字符串两端的空字符 ltrim...

支持生僻字且自动识别utf-8编码的php汉字转拼音类

拼音类文件py_class.php源码如下: <?php class py_class{ function py_class(){ $this ->...

php编写批量生成不重复的卡号密码代码

闲的蛋疼的时候,顺便加强下自己对PHP中数组操纵的一些技巧,就写了下面的一段小代码,可以随机生成卡号密码对应的数组,并且自动去重复,思路没有,纯粹瞎掰。 <?php h...

PHP二维数组的去重问题解析

之前写了一篇关于数组去重的文章,但是仅限于一维数组。下面的函数可以用于二维数组: 复制代码 代码如下: //二维数组去掉重复值 function array_unique_fb($arr...