php需要linux服务器上的功能

时间:2009-09-03 17:14:36

标签: php syntax

在linux服务器上做了这项工作吗?

<? require 'foldername/header.php' ?>

以上代码出现在home.php中。 home.php位于foldername文件夹中。

2 个答案:

答案 0 :(得分:2)

没有。你想要:

require 'header.php';

因为你已经在foldername。

这取决于你的php.ini是如何设置的,但默认行为是查看当前目录和include目录(如果有的话),所以“foldername / header.php”是相对于路径的home.php脚本。

答案 1 :(得分:0)

echo get_include_path() . ';' . $_SERVER['DOCUMENT_ROOT'];

这将显示require()相对于的目录。

它可能以“。;”开头使用DOCUMENT_ROOT将逐字描述。