Construction of the Apache+php+mysql development environment under Windows (WAMP)

Source: Internet
Author: User
Tags apache error log install php phpinfo vc runtime vc9

Preparatory work:
    • 1. Download Apache Server installation package, official website,:
    • 2. Download MySQL, official website:,:
    • 3. Download PHP, official website:,:
Installation steps: 1, install Apache server:

Recommended Apache installation path C:\wamp\apache\ First, unzip the downloaded source file to c:\wamp\apache\, then run cmd with Administrator privileges and enter the installation command at the command line:

cd /wamp/apachehttpd.exe -k install

During the installation process, may be error, the most common mistake is the VC + + Runtime is incompatible with the problem:

Cannot load modules/ into server class error appears: Please check if the ServerRoot settings in httpd.conf are correct or the VC runtime is not installed, refer to:/http

Look at the Apache error log, which resembles the following: Httpd.exe:Syntax error on line c:/wamp/apache/conf/httpd.conf:cannot load d:/php/ Php5apache2_4.dll into server:%1 \xb2\xbb\xca\xc7\xd3\xd0\xd0\xa7\xb5\xc4 Win32 \xd3\xa6\xd3\xc3\xb3\xcc\xd0\xf2\ The compiler used by Xa1\xa3 php5.5 is vc11,php5.4 and php5.3 is vc9,php5.2. Also pay attention to the x86 version, or the x64 version. Currently only php5.5 offers x64 versions, others are only x86 versions. downloaded Apache is the VC6 version, otherwise you can install different runtime libraries according to different file instructions. VC11 Runtime x86/x64 version: VC10 Runtime x86 version:/HTTP VC10 Runtime x64 version: details.aspx?id=14632 VC9 Runtime x86 version: VC9 Runtime x64 version: HTTP :// If you do not know your situation, you can install all the runtime library, no longer worry about this problem.

2. Install PHP:

Download good PHP is a compressed package, directly decompression can. Recommended decompression in C:\wamp\php\

3, Apache and PHP after loading, you need to integrate PHP and Apache
    • 1) in the Apache installation directory under the Conf directory httpd.conf add the following code:
LoadModule php5_module php安装目录/php5apache2_2.dll PHPIniDir "php安装目录" AddType application/x-httpd-php .php .phtml

Note: The above code has two installation locations and needs to be replaced by the installation path you set.

    • 2) Change php.ini-deployment to PHP.ini
    • 3) Specify the extension module path in php.ini: In php.ini, locate Extension_dir and modify to Extension_dir = PHP installation directory/ext

Here, Apache and PHP are all integrated. You can create a new phpinfo.php file in the Apache Htdocs directory and open it in the browser: http://localhost/phpinfo.php,

<?php    phpinfo();?>

If you can show phpinfo information, Apache and PHP integration success!

4, install MySQL database: directly installed. 5, to php.ini file found Extension=php_mysql.dll, Extension=php_mysqli.dll, extension=php_pdo_mysql.dll remove the front ";"

You can check the installation of MySQL by Phpinfo, or you can create a new mysqltest.php file to test it:

<?php$conn=mysql_connect("localhost","root","password");if($conn){    echo "mySQL安装成功!";}else{    echo "mySQL 为成功安装!";}?>

Here, the WAMP environment on Windows is built.

Construction of the Apache+php+mysql development environment under Windows (WAMP)

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: 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.