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 json格式和js json格式 js跨域调用实现代码

先看一个js函数 复制代码 代码如下: function jsontest() { var json = [{'username':'crystal','userage':'20'},{...

php获取CSS文件中图片地址并下载到本地的方法

本文实例讲述了php获取CSS文件中图片地址并下载到本地的方法。分享给大家供大家参考。 具体实现代码如下: 复制代码 代码如下: /**  * 获取CSS中图片地址,并且保存...

phplist及phpmailer(组合使用)通过gmail发送邮件的配置方法

本文实例讲述了phplist及phpmailer通过gmail发送邮件的配置方法。分享给大家供大家参考,具体如下: 一般来说,只要你使用的不是gmail邮箱,那么利用phplist发送邮...

php 删除记录实现代码

复制代码 代码如下:<?php @mysql_connect("localhost", "root","1981427") //选择数据库之前需要先连接数据库服务器 or die(...

php中时间函数date及常用的时间计算

曾在项目中需要使用到今天,昨天,本周,本月,本季度,今年,上周上月,上季度等等时间戳,趁最近时间比较充足,因此计划对php的相关时间知识点进行总结学习 1,阅读php手册date函数 常...