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并发多进程处理利器Gearman使用介绍

PHP并发多进程处理利器Gearman使用介绍

工作中我们有时候会遇到比如需要同时发布数据到多个个服务器上,或者同时处理多个任务。可以使用PHP的curl_multi的方式并发处理请求,但是由于网络和数据以及各个服务器等等的一些情况导...

php 无限极分类

复制代码 代码如下:<?php /*======================================================== 类名:catalog 功能:无...

WordPress的文章自动添加关键词及关键词的SEO优化

网站的关键字及网页描述关系网站对搜索引擎的友好程度,如果自己手动加显然太折腾了,那如何让wordpress博客自动为每篇文章自动关键字及网页描述。每篇文章的内容不同,我们该如何让word...

php模仿asp Application对象在线人数统计实现方法

本文实例讲述了php模仿asp Application对象在线人数统计实现方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:/* 用法: application('...

php生成固定长度纯数字编码的方法

本文实例讲述了php生成固定长度纯数字编码的方法。分享给大家供大家参考。具体如下: 很多时候我们需要一些固定长度的数字编码,如订单编号、卡号、用户编号等等!但是经常我们有的是存储在数据库...