开发者

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

开发者 https://www.devze.com 2023-04-09 14:46 出处:网络
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

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

精彩评论

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