다음 디렉터리 구성이 있습니다.
htdocs/www -> web site pages
htdocs/WEB-INF -> lib and classes, used in web pages
htdocs/data -> data (images, documents)
이것이 내가 아파치를 사용하는 방법입니다.
htdocs/www/images/logo.gif
htdocs/www/exemple/php:
<?
include_once $_SERVER["DOCUMENT_ROOT"]."/lib/classes/A.class.php";
$s=file_get_contents($_SERVER["DOCUMENT_ROOT"]."/data/content.txt");
?>
<a href="/images/logo.gif">
이것은 Apache httpd.conf를 모방한 내 lighttpd conf의 일부입니다: alias.url = ("/" => ".../htdocs/www/") server.document-root = ".../htdocs"
불행하게도 $_SERVER["DOCUMENT_ROOT"]는 htdocs 대신 htdocs/www를 가리키고 있습니다.
어떻게 고칠 수 있나요?
답변1
지금쯤 이 문제가 해결되었다고 생각합니다. 하지만 그렇지 않은 경우:
/etc/lighttpd/lighttpd.conf
에 할당된 값을 열고 편집합니다 {server.document-root}
.
다음 사항을 작성해야 합니다.전체 경로귀하의 웹 루트에. lighttpd를 다시 시작하는 것을 잊지 마십시오.