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权限是否打开,该权限决定了目录能否被浏览。

相关文章

浅谈Eclipse PDT调试PHP程序

1. 下载eclipse,从官网上找就可以了,并确认当前系统中有java环境,即jdk和jre。 2. 安装pdt了,采用的是在线安装,更新地址在默认中已经包含了。只是更新起来比较麻烦。...

WordPres对前端页面调试时的两个PHP函数使用小技巧

函数esc_js()(过滤 Html 内嵌 JS) 参数 $text (字符串)(必须)要过滤的字符串。 默认值:None 返回值 (字符串)返回过滤后的字符串。 例子 <in...

使用PHP会话(Session)实现用户登陆功能

对比起 Cookie,Session 是存储在服务器端的会话,相对安全,并且不像 Cookie 那样有存储长度限制,本文简单介绍 Session 的使用。由于 Session 是以文本文...

通过缓存数据库结果提高PHP性能的原理介绍

但当您使用的数据库与 Web 服务器位于不同的计算机上时,缓存数据库结果集通常是一个不错的方法。不过,根据您的情况确定最佳的缓存策略却是一个难题。例如,对于使用最新数据库结果集比较重要的...

php 字符过滤类,用于过滤各类用户输入的数据

详细代码如下: 复制代码 代码如下:<?php abstract class Filter { //filter parent class private $blackstr =...