Table of Contents
回复内容:
Home Backend Development PHP Tutorial 怎么看apache的根目录?我怎么导入的CSS文件找不到?

怎么看apache的根目录?我怎么导入的CSS文件找不到?

Jun 06, 2016 pm 08:08 PM
apache css html php

请问这里面,哪个是服务器的在本机windows的根目录?

<code>Variable    Value
HTTP_HOST    localhost
HTTP_CONNECTION    keep-alive
HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.8.1000 Chrome/30.0.1599.101 Safari/537.36
HTTP_DNT    1
HTTP_REFERER    http://localhost/
HTTP_ACCEPT_ENCODING    gzip,deflate
HTTP_ACCEPT_LANGUAGE    zh-CN
PATH    C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
SystemRoot    C:\Windows
COMSPEC    C:\Windows\system32\cmd.exe
PATHEXT    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR    C:\Windows
SERVER_SIGNATURE    no value
SERVER_SOFTWARE    Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/5.6.18
SERVER_NAME    localhost
SERVER_ADDR    ::1
SERVER_PORT    80
REMOTE_ADDR    ::1
DOCUMENT_ROOT    C:/AppServ/www
REQUEST_SCHEME    http
CONTEXT_PREFIX    no value
CONTEXT_DOCUMENT_ROOT    C:/AppServ/www
SERVER_ADMIN    admin@example.com
SCRIPT_FILENAME    C:/AppServ/www/info.php
REMOTE_PORT    49557
GATEWAY_INTERFACE    CGI/1.1
SERVER_PROTOCOL    HTTP/1.1
REQUEST_METHOD    GET
QUERY_STRING    no value
REQUEST_URI    /info.php
SCRIPT_NAME    /info.php</code>
Copy after login
Copy after login
<code>为什么我在www文件下定义了一个css文件,用:<link rel="stylesheet" type="text css" href="/css.css">
不行!</code>
Copy after login
Copy after login
<code>而用:<link rel="stylesheet" type="text css" href="/www/css.css">
就行了???</code>
Copy after login
Copy after login

根目录不是 C:/AppServ/www 吗?

回复内容:

请问这里面,哪个是服务器的在本机windows的根目录?

<code>Variable    Value
HTTP_HOST    localhost
HTTP_CONNECTION    keep-alive
HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.8.1000 Chrome/30.0.1599.101 Safari/537.36
HTTP_DNT    1
HTTP_REFERER    http://localhost/
HTTP_ACCEPT_ENCODING    gzip,deflate
HTTP_ACCEPT_LANGUAGE    zh-CN
PATH    C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;
SystemRoot    C:\Windows
COMSPEC    C:\Windows\system32\cmd.exe
PATHEXT    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDIR    C:\Windows
SERVER_SIGNATURE    no value
SERVER_SOFTWARE    Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/5.6.18
SERVER_NAME    localhost
SERVER_ADDR    ::1
SERVER_PORT    80
REMOTE_ADDR    ::1
DOCUMENT_ROOT    C:/AppServ/www
REQUEST_SCHEME    http
CONTEXT_PREFIX    no value
CONTEXT_DOCUMENT_ROOT    C:/AppServ/www
SERVER_ADMIN    admin@example.com
SCRIPT_FILENAME    C:/AppServ/www/info.php
REMOTE_PORT    49557
GATEWAY_INTERFACE    CGI/1.1
SERVER_PROTOCOL    HTTP/1.1
REQUEST_METHOD    GET
QUERY_STRING    no value
REQUEST_URI    /info.php
SCRIPT_NAME    /info.php</code>
Copy after login
Copy after login
<code>为什么我在www文件下定义了一个css文件,用:<link rel="stylesheet" type="text css" href="/css.css">
不行!</code>
Copy after login
Copy after login
<code>而用:<link rel="stylesheet" type="text css" href="/www/css.css">
就行了???</code>
Copy after login
Copy after login

根目录不是 C:/AppServ/www 吗?

看 DOCUMENT_ROOT

apachehttpd.conf文件 搜索DocumentRoot查看apache指定的根目录

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP: Handling Databases and Server-Side Logic PHP: Handling Databases and Server-Side Logic Apr 15, 2025 am 12:15 AM

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

PHP's Purpose: Building Dynamic Websites PHP's Purpose: Building Dynamic Websites Apr 15, 2025 am 12:18 AM

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

HTML: Is It a Programming Language or Something Else? HTML: Is It a Programming Language or Something Else? Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

PHP: An Introduction to the Server-Side Scripting Language PHP: An Introduction to the Server-Side Scripting Language Apr 16, 2025 am 12:18 AM

PHP is a server-side scripting language used for dynamic web development and server-side applications. 1.PHP is an interpreted language that does not require compilation and is suitable for rapid development. 2. PHP code is embedded in HTML, making it easy to develop web pages. 3. PHP processes server-side logic, generates HTML output, and supports user interaction and data processing. 4. PHP can interact with the database, process form submission, and execute server-side tasks.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

How to run nginx apache How to run nginx apache Apr 14, 2025 pm 12:33 PM

To get Nginx to run Apache, you need to: 1. Install Nginx and Apache; 2. Configure the Nginx agent; 3. Start Nginx and Apache; 4. Test the configuration to ensure that you can see Apache content after accessing the domain name. In addition, you need to pay attention to other matters such as port number matching, virtual host configuration, and SSL/TLS settings.

How to build a Zookeeper cluster in CentOS How to build a Zookeeper cluster in CentOS Apr 14, 2025 pm 02:09 PM

Deploying a ZooKeeper cluster on a CentOS system requires the following steps: The environment is ready to install the Java runtime environment: Use the following command to install the Java 8 development kit: sudoyumininstalljava-1.8.0-openjdk-devel Download ZooKeeper: Download the version for CentOS (such as ZooKeeper3.8.x) from the official ApacheZooKeeper website. Use the wget command to download and replace zookeeper-3.8.x with the actual version number: wgethttps://downloads.apache.or

See all articles