For more information about Apache (LAMP) configuration in windows, see Figure

Source: Internet
Author: User

I have encountered this tangle problem when I Just configured the lamp environment. I still don't know where the error is?

Write a phpinfo. php file in the working directory, and enter the path to open it, as shown in;

But what you get with localhost/phpinfo. php is shown in;

Then, find some information on the Internet, modify the httpd. conf file, and enter localhost/phpinfo. php again, as shown in;

Why?

The configuration of the httpd. conf file of Apache in the first example is as follows:

//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// ////////////////////////////////////////

[Apache configuration]
5.1> httpd. conf (D:/lamp/apache2.2/conf)
5.1.1> # function: load the PHP Module
# Note: Search for loadmodule and add it after it
Loadmodule php5_module "D:/lamp/PHP/php5apache2_2.dll"

5.1.2> # function: Set the working directory
# Note: Search for DocumentRoot and change it
DocumentRoot "D:/lamp/sites"

5.1.3> # function: Set directory options
# Note: Search for <directory "D:/lamp/apache2.2/htdocs"> and change it
<Directory "D:/lamp/sites">

5.1.4> # function: Set the default document
# Note: Search <directory/> and add
Directoryindex index. php index.html

5.1.5> # function: adds the PHP type.
# Note: Add at the end of the file
Addtype application/X-httpd-PHP. html. php

# Function: directory of PHP. ini
# Note: Add at the end of the file
Phpinidir "D:/lamp/PHP"

Function: the directory cannot be accessed.
: Search options indexes followsymlinks and comment out
# Options indexes followsymlinks

5.2> Note: After the configuration file is modified, restart Apache to take effect.

5.3> create a file in D:/lamp/sites/
# Phpinfo. php
Input content:
<? PHP
Phpinfo ();
?>
Access: http: // localhost/phpinfo. php

//////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// As shown above, the ticket is unsuccessful. Please advise.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.