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读取文件内容至字符串中,同时去除换行、空行、行首行尾空格(Zjmainstay原创)

复制代码 代码如下: <?php  /*   *读取文件内容至字符串中,同时去除换行、行首行尾空格。   */ header("Content-type: text/html; c...

PHP中使用数组指针函数操作数组示例

数组的内部指针是数组内部的组织机制,指向一个数组中的某个元素。默认是指向数组中第一个元素通过移动或改变指针的位置,可以访问数组中的任意元素。对于数组指针的控制PHP提供了以下几个内建函数...

php短网址和数字之间相互转换的方法

本文实例讲述了php短网址和数字之间相互转换的方法。分享给大家供大家参考。具体实现方法如下: <?php /** * 将数字转为短网址代码 * * @param...

swfupload 多文件上传实现代码

var swfu; window.onload = function() { var settings = { flash_url : "js/swfupload_f9.swf", //...

Windows 下安装 swoole 图文教程(php)

Windows 下安装 swoole 图文教程(php)

Windows 下安装 swoole 具体步骤: Swoole,原本不支持在Windows下安装的,所以我们要安装Cygwin来使用。在安装Cygwin下遇到了很多坑,百度经验上的文档不...