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 http://www.apache.org/,:http://httpd.apache.org/download.cgi
    • 2. Download MySQL, official website: http://www.mysql.com/,: http://dev.mysql.com/downloads/mysql/
    • 3. Download PHP, official website: http://php.net/,: http://windows.php.net/qa/
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/mod_actions.so 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 Www.2cto.com/os/201312/264364.html

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. apache.org downloaded Apache is the VC6 version, otherwise you can install different runtime libraries according to different file instructions. VC11 Runtime x86/x64 version: http://www.microsoft.com/en-us/download/details.aspx?id=30679 VC10 Runtime x86 version:/HTTP www.microsoft.com/en-us/download/details.aspx?id=5555 VC10 Runtime x64 version: http://www.microsoft.com/en-us/download/ details.aspx?id=14632 VC9 Runtime x86 version: http://www.microsoft.com/en-us/download/details.aspx?id=5582 VC9 Runtime x64 version: HTTP ://www.microsoft.com/en-us/download/details.aspx?id=15336 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)

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.