Search code examples
phppathinclude-path

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 uploaded 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.


Solution

  • 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.