Environment: Lampp on a Ubuntu build
Problem: When I was doing web development on a windows server the
include('/');
<script src="/style.css"...
referred to the web root directory and it was easy to set all paths with '/'. Now that I am using Lampp on Unix the '/' directory path does not refer to th开发者_C百科e web root, it goes back further. After researching about this, I suppose it is used for sub-domains ect... I couldn't find a way to set the '/' path to be the web root on Lampp. Any help?
Edit: However using
$_SERVER['DOCUMENT_ROOT'];
It returns the the web root properly. Not sure why...
include('/');
<script src="/style.css"...
...are not working correctly.
精彩评论