Apache的平行路径文档根 [英] Apache Parallel Path Document Root

查看:169
本文介绍了Apache的平行路径文档根的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站的Apache2中设置(Windows 7)中,说我的的DocumentRoot是/ mysite的/内容

I have a website set up in apache2 (Windows 7), say my DocumentRoot is /mysite/content

但我也有包括在一个平行的目录,比如/ mysite的/ lib目录

but I also have includes in a parallel directory, say /mysite/lib

所以我的index.php文件说:

so my index.php file says:

require_once("/mysite/lib/myfile.php");

但它不会找到该文件,因为它需要它的文档根目录。因此它正在寻找

but it won't find the file because it takes it from the document root. so it is looking for

/mysite/content/mysite/lib/myfile.php instead of /mysite/lib/myfile.php

和因为包含的文件指的是根的mysite /内容我不能让根/ mysite的。任何想法如何解决这个问题?

and I can't make the root /mysite because the files included are referring to the root, mysite/content. any ideas how to get around this?

推荐答案

您必须更改包括在php.ini文件路径

you have to change the include path in the php.ini file

这篇关于Apache的平行路径文档根的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆