How to configure apache + mysql + php + phpmyadmin in windows

Source: Internet
Author: User
Tags mysql tutorial php download vc9

There is nothing to say about the apache server. Try to download the latest one from the official website.

Note that the php tutorial loads data to the apache container in the form of a module, that is, when you configure apache to load the php module, pay attention to the path. Specific configuration statement

Loadmodule php5_module d:/php/php5apache2. dll is used to load php in module mode.

Phpinidir "d:/php" indicates the location of the php configuration file php. ini.

Do not contain spaces in this path. For example, the path for my path is loadmodule php5_module d:/peogram files/php/php5apache2. dll will cause an error. You need to replace it with a relative path, such ".. /php/php5apache2. dll ", but the relative path must be correct, depending on how you install each module, it is recommended to install in a unified directory for convenient management.

Php has to pay attention to this issue. Below is the php download

Php 5.3 (5.3.5) window platform package download


Vc9 x86 non thread safe (2011-jan-05 21:37:35)
  • Zip [14.96 mb]
    Sha1: 2fdd7b2b17d359725d9f297b6a59f17b71a913a6
  • Installer: [26.9 mb]
    Sha1: d7cfd584231e68dc9e87cdff45a6d11fa3b03689
  • Debug pack [7.94 mb]
    Sha1: 414c30a12a402d3af30b46de4b2e0ca391872982
Vc9 x86 thread safe (2011-jan-05 21:31:04)
  • Zip [15.1 mb]
    Sha1: 7593b0ebba4b43418fd2f3c18eac83d698da46d6
  • Installer: [27.02 mb]
    Sha1: db510126e3f9b580c38fb6dd8895e5a67403a223
  • Debug pack [8.29 mb]
    Sha1: 339f6092e4c4fee9c5a6a0f6d0f8359fbfbda60b
Vc6 x86 non thread safe (2011-jan-06 19:06:20)
  • Zip [13.13 mb]
    Sha1: b11a6a1597219d7ce10bc315cde411f37213383e
  • Installer: [23.84 mb]
    Sha1: 20179683e8b88ceed32bf12c0b883a51bb10e43d9
  • Debug pack [4.86 mb]
    Sha1: 9fb328a8c798bfe797e1a7f683571dc3812f3aa8
Vc6 x86 thread safe (2011-jan-06 18:56:08)
  • Zip [13.26 mb]
    Sha1: 8658b5c58a9893d46290beb70aa2335226e2c523
  • Installer: [23.95 mb]
    Sha1: 05fe4fb8f03a2f9fa71d47aad60e8c9becd6bb7d
  • Debug pack [5.03 mb]
    Sha1: 9d96d42b14f516ee5935404161836ec28b572bbf
  • There are four options for you to choose from. However, you must select the correct one.
  • What is vc6?
    Vc6 is compiled by the legacy visual studio 6 compiler.
    What is vc9?
    Vc9 is the visual studio 2008 compiler, which is compiled by Microsoft vs editor.

    So how do we choose which php version to download?
    If you are using apache + php in windows, select vc6;
    If you are using iis + php in windows, select vc9;

    What is non thread safe?
    Non-thread safe is non-thread security;
    What is thread safe?
    Non thread safe is thread security;
    We do not recommend that you use non-thread safe in the production environment, so we use php of thread safe.

    I chose vc6 x86 thread safe (2011-jan-06 18:56:08) because I set up an apache server in windows.

    Php directly decompress the package and install the package. Step by step.

    Common problems are:

    Unable to load dynamic library 'd:/server/php/ext/php_exif.dll'
    Unable to load dynamic library 'd:/server/php/ext/php_fdf.dll'
    Unable to load dynamic library 'd:/server/php/ext/php_ifx.dll'


    For similar errors, the solution is

    1. Modify the extension_dir configuration of the php. ini file to your correct php/ext/, because this folder contains all your expansion modules, including the mysql tutorial.

    2. copy the dll files in your php installation directory and the dll files in the php/ext file to the widows/0system32 directory, or modify the path of the system environment variable and add d: /www/php; d:/www/php/ext; this is my installation directory. The effect of this implementation is the same as that of copying to system32. For the specific reason, I don't know why. I only know that when running the program, I first find the corresponding library file under system32 for loading, if it is found, it will be stopped. If it cannot be found, it will be searched under path. If it cannot be found, it will be searched under the configuration file extesion_dir. If it cannot be found, an error will be reported, if you have installed php4 on your computer, delete the corresponding dll file under system32 first.

    3. Whether the loaded modules are loaded or deleted is configured in php. ini.

    SimilarExtension = php_bz2.dll

    Extension = php_curl.dll

    Extension = php_fileinfo.dll

    Extension = php_gd2.dll

    Extension = php_gettext.dll

    ; Extension = php_gmp.dll

    Extension = php_intl.dll

    Be sure not to start all modules. Although the system resources are wasted, the corresponding dll of this module does not exist in the default php5 installation package, therefore, you should disable the corresponding module according to the system error prompt. The method of disabling the module is the opposite to how you enable the module.

    4. there is also dependency between modules. For example, if you want to enable the extension = php_exif.dll module, you must first enable the extension = php_mbstring.dll module, which may be the cause of the failure of adding the module.

    It is easy to install mysql. Just install mysql as prompted. You do not need to configure it with each module of the server.

    The latest phpmyadmin version has been updated to Many of the Configuration Methods circulating on the Internet are earlier versions and are not suitable for the new version; so flymorn also listed the configuration steps of phpmyadmin2.11.5.1 below. For the convenience of switching and debugging php, I used windows and local debugging.

    1. First download the phpmyadmin installation package:
    To foreign official website, click the navigation bar on the Downloads page, select “ version to download to local, decompress the file to the system specified virtual root directory phpmyadmin folder (can be customized folder name ), for example, the local storage location of flymorn is d: wwwphpmyadmin.


    2. Find the/libraries/config. default. php file in the phpmyadmin folder (the old version is the config. inc. php file under the root directory) and open it with a UTF-8-supported WordPad for editing.


    3. Search for $ cfg ['pmaabsoluteuri ']
    Modify the phpmyadmin URL that you will upload to the space
    For example, $ cfg ['pmaabsoluteuri '] = 'HTTP: // /';
    Here, because I am local debugging, I changed it to $ cfg ['pmaabsoluteuri '] = 'HTTP: // localhost/phpmyadmin /';
    Note: Do not miss the last backslash (/) and http at the beginning.


    4. Search for $ cfg ['servers'] [$ I] ['host'] = 'localhost'; (the default value is usually used, and there are exceptions. You do not need to modify the value)


    5. Find $ cfg ['servers'] [$ I] ['auth _ type'] = 'config ';
    Debug config in your own machine; if the space on the network uses cookies, now that we have added a URL before, we will change it to a cookie.
    My personal suggestion: both on the local network and on the network, we recommend that you set the cookie to be the first in security.
    At the same time, when the auth_type value is set to cookie, there is also a need to make the appropriate changes:
    $ Cfg ['blowfish _ secret'] = '';
    Change to: $ cfg ['blowfish _ secret'] = 'www '; can be defined at will, with no more than 46 characters. If this field is left blank, the above 2nd error will occur: "the configuration file now requires a top secret phrase password (blowfish_secret )".


    6. Search for $ cfg ['servers'] [$ I] ['user'] = 'root'; // mysql user (user name, root in your machine; this is generally your ftp user name on the Internet, which the VM provider will tell you. Do not change it)


    7. Search for $ cfg ['servers'] [$ I] ['Password'] = '2016 '; // mysql password (123456 changed to the user password used to connect to your mysql database tutorial)


    8. find $ cfg ['defaultlang '] = 'zh'. (select the language. zh indicates the meaning of Simplified Chinese) $ cfg ['defaultcharset'] = 'gb2312)


    Now, phpmyadmin has been configured. You can enable http: // localhost/phpmyadmin/to access the convenient and convenient graphical management software phpmyadmin. For other options in the configuration file that are not mentioned in this article, you don't have to worry about it or modify it. The specific operations on phpmyadmin are not covered in this article. However, the graphical interface is easy to understand and can be used for a moment (refer ).


    Next, let's talk about several problems that flymorn encountered when installing and configuring phpmyadmin.


    The first problem: "The mcrypt extension cannot be loaded. Check the php configuration ".


    1. the mysql database is not correctly installed, and mysql-related services are not started in the system service.
    2. libmcrypt is missing in the system32 (c: windowssystem32) Directory of the system. dll file. The solution is to find libmcrypt under the php Directory. dll, and libmcrypt. copy the dll to the c: windowssystem32 directory and restart the web service.
    3. php under the php Directory. in the INI file, the previous ";" in "; extension = php_mcrypt.dll" is not removed, so the corresponding function cannot be used. The solution is to open php. INI file, find it; replace extension = php_mcrypt.dll with extension = php_mcrypt.dll // remove the previous one to make it take effect.
    4. the mysql directory has no read permission. The correct directory permission is as follows:
    Full administrator control
    Full system control
    User reading and running
    All other user permissions can be deleted (or retained, but the security is not high, it is recommended to delete), and then restart the mysql service and web Service (it is recommended to modify this item and then restart the server ).
    5. If none of the above methods works, use this method: desktop> my computer> right-click Properties> advanced> environment variables> system variables> New
    Name: phpdir
    Value: c: php (what directory is your php)
    (Reference Source: address)


    The second problem: "mysql extension cannot be loaded. Check the php configuration"


    Copy libmysql. dll in the php Directory to: c: windowssystem32, and restart apache.


    Third question: "the configuration file now requires a top secret phrase password (blowfish_secret )"


    Make sure that the correct settings are made in the config. default. php file:
    $ Cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';
    At the same time
    $ Cfg ['blowfish _ secret '] = 'www'; // (this value can be written at will, but cannot be left blank)


    In fact, this problem is really depressing. If I did it according to the configuration method I mentioned above, it would not prompt this error. After more than two hours of modifying the config. default. php configuration file, I always indicated this error, almost reaching the edge of the crash.


    Then, Ling Guang suddenly found that when I changed the auth_type authentication method to http and changed it to config, this error always occurred when I opened the page. That is to say, the authentication mode has changed and does not work for phpmyadmin, is phpmyadmin affected by other configuration files?


    I immediately came to the phpmyadmin root directory and found that a config. sample. inc. php file exists under the root directory, and a config. inc. php file exists !! This is a configuration file of the old version. It turns out to be a ghost of this file. Immediately delete config. inc. php and go to the debugging page. The error disappears! Solve the problem.


    It seems that the config. inc. php configuration file Priority Ratio/libraries/config. default. the php configuration file is high. The system first calls the configuration file in the root directory, and then the configuration file in the libraries folder. AI, this problem has been so long and I am sorry. The solution is always done. Just breathe a sigh of relief.


    Fourth question: "#2003-the server has not responded ".


    Most of these problems occur when the mysql database is not started. We recommend that you directly start mysql in the control panel-management tools-service. You can run a process such as running mysqld-nt.exe on the task manager. If yes, mysql is started.

    Fifth problem: "No php extension settings mbstring are found ".


    Modify the c: php. ini file in windows, and find; extension = php_mbstring.dll; remove it, save php. ini, and restart apache.

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.