开发者

Xampp Unix - Absolute file paths?

开发者 https://www.devze.com 2023-03-06 18:44 出处:网络
Environment: Lampp on a Ubuntu build Problem: When I was doing web development on a windows server the

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.

0

精彩评论

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

关注公众号