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 命令行参数详解及应用

复制代码 代码如下:# 不带参数的执行格式 php安装目录/bin/php scriptname.php # 带参数的执行格式 php安装目录/bin/php scriptname.ph...

php 中phar包的使用教程详解

php 中phar包的使用教程详解

修改配置文件: vim /usr/local/php/etc/php.ini [Phar] phar.readonly = Off 压缩: a. 创建压缩脚本: vim c...

php中使用接口实现工厂设计模式的代码

接口在php只能起到约束类的定义作用,虽不像c#/java那么直观,但基于oop的封装要求,使用接口可以提高程序的可扩展性,如实现代理设计模式。 复制代码 代码如下: <?php...

php5.3提示Function ereg() is deprecated Error问题解决方法

本文实例讲述了php5.3提示Function ereg() is deprecated Error问题解决方法。分享给大家供大家参考。具体实现方法如下: 一、问题: PHP 5.3 e...