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");
精彩评论