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中隐形字符65279(utf-8的BOM头)问题

今天在CSDN看到一个php输出空白隐形字符65279的问题,在网上找了下,发下这个65279字符是php用来标记文件是utf-8编码的,输出的时候会一起输出到客户端,导致客户端如果使用...

PHP加密函数 Javascript/Js 解密函数

以下函数代码中“123456” 是个加密的key,自己可以随便改。php加密,js解密,貌似没什么意义,主要是key在js中会被看到。不过在某些地方可能会用到。 PHP加密函数 复制代码...

php字符串过滤与替换小结

本文实例总结了php字符串过滤与替换的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:<?php class cls_string_filter{ &n...

PHP调用其他文件中的类

首先在一个tool.php文件中声明一个类: <?php class tool { function say(){ $result="Hello,Worl...

10款PHP开源商城系统汇总介绍

  在当今经济危机的大环境下,网上购物越来越来吃香,网上开店成本低,快捷方便,出名的电子商务网站有淘宝,拍拍,Ebay或是最新的百度有啊,这些网站都提供开店的机会,如果是想自己搭建购物平...