我想要做的是设置我的网站的开发子域。是否有可能链接PHP需求?
的结构基本上这样的:
/vitals.php <-- Contains the actual info (passwords, db info, etc...)
/public_html/vitals.php <-- contains only require("../vitals.php")
/public_html/index.php
/public_html/dev/index.php
在的public_html索引文件具有require("../vitals.php")
。我希望能够通过在public html中添加额外的vitals.php来在dev/index.php
文件中使用相同的行,这将在public_html之外包括vital.php
。
问题是......它不起作用。想法?
你尝试'需要( “../../ vitals.php”)'?你的问题有点模糊,难以理解,请澄清。 – 2013-03-14 00:21:41
我建议你在一个根文件中定义一个代表你的应用程序根路径的常量(例如:define('APPLICATION_PATH',__DIR__'),然后在你的所有include或requiered中使用它以便给绝对路径因为用你的方法,你玩的是相对路径,你可能会感到困惑。看看:http://php.net/manual/en/language.constants.predefined.php – MatRt 2013-03-14 00:21:45
“它不起作用“不是一个解释 – zerkms 2013-03-14 00:21:46