开发者

How do I know the server path for adding to an include_path

I have everything working locally with php_value include_path "C:/wamp/www/project" in my htaccess file, but I don't know what to set this value to once it's upload开发者_JS百科ed to the server. I tried the actual url but it didn't work; I'm guessing this needs to be relative to the server, but I'm not sure how to extrapolate the appropriate server path.


One of the ways is to upload a test script to your server and

echo dirname(__file__); 

You can see the path of the directory in which your file is.

Another way is to

echo $_SERVER['DOCUMENT_ROOT']'

I hope it helps.


if you have "library.php" in your C:/wamp/www/project/libs you'd use

php_value include_path "C:/wamp/www/project/libs/"

and using it like

include("library.php");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜