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

相关文章

Mac下关于PHP环境和扩展的安装详解

一直使用windows和Centos进行开发,之前公司配了Mac本,放家里吃灰了一年,新公司还是Mac,无奈只好从头摸索。 php安装主要使用brew,请注意 由于git上原homebr...

php完全过滤HTML,JS,CSS等标签

记得以前写过一篇文章 php有效的过滤html标签,js代码,css样式标签: 复制代码 代码如下:<?php $str = preg_replace( "@<script(...

PHP获取指定函数定义在哪个文件中以及其所在的行号实例

当调试开源的代码时,希望查看某个函数的定义,那么就需要定位其位置。在 zend studio 这样的 IDE 中自是可以自动提示到,但当没有安装这样的开发工具时,我们可以怎么办呢?参考如...

php数组比较实现查找连续数的方法

本文实例讲述了php数组比较实现查找连续数的方法。分享给大家供大家参考。具体如下: $data = array(); $data[]= array("01" ,"02", "18"...

支持中文字母数字、自定义字体php验证码代码

复制代码 代码如下: <?php /* * Captcha Class base on PHP GD Lib * @author Design * @version 1.0 * @...