Install and configure Apache + PHP + MySql

Source: Internet
Author: User

Thank you for the guidance of dt27 ~~~ Saving me a lot of effort

1. install PHP

We just downloaded the PHP compressed package and decompress it. Here We decompress it to the C: PhP folder (not the path you need to decompress, but your personal preferences ).

2. install Apache

Before installing Apache, you must note that if IIS is installed on your computer or thunder is running (sometimes port 80 is occupied by thunder running), disable it first, because Apache is a server that provides web services, port 80 is required.

Like installing other software, install the software one by one and select Custom as the installation type. You can select the installation path and install it in the: D:/ProgramFiles/apache2.2 folder, after the installation is complete, Apache is started on its own. The Apache icon appears in the system tray area in the lower right corner of the desktop. The green triangle indicates regular running (if it is red, check whether your port is occupied ).

Enter http: // localhost in your IE browserWe should see "itworks! "

3. Install MySQL

Next, select m for installation, and select the installation path. Here I select D: Program filesmysql for installation.

Continue to "Please select"The default characterset ", which allows you to select the default character set. Here we select" Best supoortmultilingualism ", that is, utf8 is selected as the default Character Set of MySQL.

Continue to next, to the place where there are two text boxes, here is to let you fill in the management password (other do not need to change), after entering the next, then click execute, and finally finish the installation of MySQL.

4. Configure Apache and PHP

1) Configure Apache
Use NotePad to open the D:/program files/apache2.2/CONF/httpd. conf file,
Find # loadmodule vhost_alias_module modules/mod_vhost_alias.so
Add a row to the end

Loadmodule php5_modulec:/PHP/php5apache2_2.dll

Find addtype application/X-gzip. GZ. tgz
Add a row to the end

Addtype application/X-httpd-PHP. php

Find directoryindex index.html and modify it

Directoryindex index.html index.htm index. php (the default page of the website is modified here. You can add it as needed)

Listen 80 is the default port number. You can modify it as needed. We will not modify it here.

Find DocumentRoot "D:/program files/apache2.2/htdocs"
The path in the quotation marks is the path of your website and directory. The PHP program you write later can be accessed only when it is placed in this directory (note that the path is Slash "/"). Here we change it

DocumentRoot "D:/dzstu"

Find <directory "D:/ProgramFiles/apache2.2/htdocs"> and change it

<Directory "D:/dzstu">

2) Configure PHP
Copy the C:/PHP. ini-recommended file to the C:/Windows Directory, change the file name to PhP. ini, and open it in notepad.

Find extension_dir = "./" and change it

Extension_dir = "C:/PHP/EXT" (based on your PHP installation location)

Find
; Extension = php_mbstring.dll
; Extension = php_gd2.dll
; Extension = php_mysql.dll
; Extension = php_mysqli.dll
Remove the semicolon before them. This is a common PHP extension. You can remove the semicolon before other extensions as needed.

Finally, set C:/PHP/libmysql. DLL, C:/PHP/EXT/php_mysql.dll, C:/PHP/EXT/php_mysqli.dll, C:/PHP/EXT/php_mbstring.dll and copy them to C:/windowssystem32, make PHP support MySQL

5. Test

Create a file test. php In the D:/dzstu folder and write

<? PHP
Phpinfo ();
?>

Open http: // localhost/test. php in IEThe PHP configuration is displayed, indicating that the PHP environment is successfully configured.

6. Install phpMyAdmin

PhpMyAdmin is a Web-based MySQL management program. It is a popular MySQL management program.
We decompress the downloaded phpMyAdmin to the d:/dzstuphpmyadmin folder, and then access it through http: // localhost/phpMyAdmin.
The following error occurs:
Probably reason of this is that you did not create configurationfile. You might want to use setup script to create one.
Click the "setup script" link as prompted to go to the configuration and installation page. Click "add" in "servers ".
Server Hostname: localhost
Authentication Type: Select HTTP
You don't need to change anything else. Click the Add button, close the browser, clear the cache, and access it again.

7. All installation and configuration are complete.

Article Source http://www.dzstu.com/article.php? Id = 79

Related Article

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.