Home >Backend Development >PHP Tutorial >Configuration method of apache+mysql+php+phpmyadmin under windows_PHP tutorial

Configuration method of apache+mysql+php+phpmyadmin under windows_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:08:19997browse

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

There is one thing you need to pay attention to: the php tutorial is loaded into the apache container in the form of a module. When you configure apache to load the php module, pay attention to the path problem. Specific configuration statements

loadmodule php5_module d:/php/php5apache2.dll refers to loading php in module mode

phpinidir "d:/php" specifies the location of the php configuration file php.ini

Try not to have spaces in this path. For example, my path is loadmodule php5_module d:/peogram files/php/php5apache2.dll. This will cause an error. You need to change it to a relative path, such as "../php/php5apache2 .dll", but the relative path must be correct. It depends on how you install each module. It is recommended to install it in the same directory for easy management.

You have to pay attention to PHP, this problem is very confusing. Below is the download of php

php 5.3 (5.3.5) window platform package download

vc9 x86 non thread safe (2011-jan-05 21:37:35)

  • zip [14.96mb]
    sha1: 2fdd7b2b17d359725d9f297b6a59f17b71a913a6
  • installer [26.9mb]
    sha1: d7cfd584231e68dc9e87cdff45a6d11fa3b03689
  • debug pack [7.94mb]
    sha1: 414c30a12a402d3af30b46de4b2e0ca391872982

vc9 x86 thread safe (2011-jan-05 21:31:04)

  • zip [15.1mb]
    sha1: 7593b0ebba4b43418fd2f3c18eac83d698da46d6
  • installer [27.02mb]
    sha1: db510126e3f9b580c38fb6dd8895e5a67403a223
  • debug pack [8.29mb]
    sha1: 339f6092e4c4fee9c5a6a0f6d0f8359fbfbda60b

vc6 x86 non thread safe (2011-jan-06 19:06:20)

  • zip [13.13mb]
    sha1: b11a6a1597219d7ce10bc315cde411f37346383e
  • installer [23.84mb]
    sha1: 4249683e8b88ceed32bf12c0b883a51bb10e43d9
  • debug pack [4.86mb]
    sha1: 9fb328a8c798bfe797e1a7f683571dc3812f3aa8

vc6 x86 thread safe (2011-jan-06 18:56:08)

  • zip [13.26mb]
    sha1: 8658b5c58a9893d46290beb70aa2335226e2c523
  • installer [23.95mb]
    sha1: 05fe4fb8f03a2f9fa71d47aad60e8c9becd6bb7d
  • debug pack [5.03mb]
    sha1: 9d96d42b14f516ee5935404161836ec28b572bbf
  • There are four types for you to choose from. But be sure to choose the right one.
  • What is vc6?
    vc6 is the legacy visual studio 6 compiler, which is compiled using this compiler.
    What is vc9?
    vc9 is the visual studio 2008 compiler, which is compiled with Microsoft's vs editor.

    So how do we choose which version of php to download?
    If you are using apache+php under windows, please choose the vc6 version;
    If you are using iis+php under windows, please choose vc9 version;

    What is non thread safe?
    non thread safe means non thread safe;
    What is thread safe?
    non thread safe is thread safe;
    The official does not recommend that you use non-thread safe in the production environment, so we choose the thread safe version of php to use

    I chose vc6 x86 thread safe (2011-jan-06 18:56:08) because I built the apache server under windows.

    php can be installed by decompressing it directly. Just follow the tutorial step by step.

    Frequently asked questions 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'

    ……

    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 mysql tutorials and the like.

    2. Copy all the dll files in your php installation directory and php/ext file to windows/0system32, or you can modify the system environment variable path and add; d:/www/php;d:/www/php/ext;This is my installation directory. The effect of this implementation is the same as copying it to system32. I don’t know the specific reason. I only know that when the program is running, it first goes to system32 to find the corresponding library file to load. If it is found, it will stop. If it cannot be found, it will stop. Just go and search under the path. If you can't find it again, go and search under the configuration file extension_dir. If you can't find it again, you will get an error. So if you have installed php4 on your computer before, please delete the corresponding dll file under system32 first. Lose.

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

    is similar to extension=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 system resources are not wasted, the corresponding dll of this module does not necessarily exist in the default php5 installation package, so you should follow the system The error message indicates that the corresponding module has been deactivated. The deactivation method is opposite to how you enable the module.

    4. There are also dependencies between modules. For example, if I want to open the extension=php_exif.dll module, I must first open the extension=php_mbstring.dll module. This may also be the case if you add The reason why the module was unsuccessful.


    Installing mysql is very simple, just follow the prompts to install it. There is no need to configure the various modules of the server

    Since the latest version of phpmyadmin has been updated to 2.11.5.1, many configuration methods circulated on the Internet are from the old version and are no longer suitable for the configuration requirements of the new version; so flymorn also added phpmyadmin2.11.5 The configuration steps of .1 are also listed below; in order to facilitate switching and debugging PHP, I use the Windows system and debug locally.

    1. First download the phpmyadmin installation package:
    Go to the official foreign website http://www.phpmyadmin.net, click the "downloads" link on the navigation bar to enter the download page, select the "all-languages.zip" version to download locally, decompress it; put the decompressed file into the system In the phpmyadmin folder under the specified virtual root directory (the folder name can be customized), 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 in the root directory), open it for editing with a WordPad that supports utf-8 encoding.

    3. Search $cfg['pmaabsoluteuri']
    Change it to the URL of phpmyadmin that you will upload to the space
    For example: $cfg['pmaabsoluteuri'] = 'http://www.piaoyi.org/phpmyadmin/';
    Because I am debugging locally, I changed it to $cfg['pmaabsoluteuri'] = 'http://localhost/phpmyadmin/';
    Note: Don’t miss the last backslash / and the beginning http.

    4. Search $cfg['servers'][$i]['host'] = 'localhost'; (usually the default is used, there are exceptions, and no modification is required)

    5. Search $cfg['servers'][$i]['auth_type'] = 'config';
    Use config for debugging on your own machine; if you use cookies in the network space, since we have added the URL before, we will change it to cookies.
    My personal suggestion: Whether it is local or online, it is recommended to set cookies, safety first.
    At the same time, when the auth_type value is set to cookie, there is still one place that needs to be modified accordingly:
    $cfg['blowfish_secret'] = '';
    Change to: $cfg['blowfish_secret'] = 'www.piaoyi.org';
    The www.piaoyi.org here can be defined by yourself, no more than 46 characters. If this field is left blank, the second error mentioned above will appear: "The configuration file now requires a top-secret phrase password (blowfish_secret)".

    6. Search $cfg['servers'][$i]['user'] = 'root'; // mysql user (user name, use root on your machine; on the Internet, it is usually your ftp user name , the virtual host provider will tell you; generally do not modify it)

    7. Find $cfg['servers'][$i]['password'] = '123456'; // mysql password (change 123456 to the user password for connecting to your mysql database tutorial)

    8. Find $cfg['defaultlang'] = 'zh'; (here is the language selection, zh represents Simplified Chinese) and $cfg['defaultcharset'] = 'gb2312'; (modify the default encoding to National standard)

    At this point, phpmyadmin has been configured; you can open http://localhost/phpmyadmin/ to access the convenient and fast graphical management software phpmyadmin. Regarding other options in the configuration file not mentioned in this article, you don’t need to worry about it or modify it. The specific how to operate phpmyadmin is beyond the scope of this article, but the graphical interface is easy to understand and you will be able to use it after just a quick look (reference).

    Let’s talk about several problems encountered by flymorn during the installation and configuration of phpmyadmin.

    The first question: "Unable to load the mcrypt extension, please check the php configuration".

    1. The mysql database is not installed correctly, and the mysql-related services in the system services are not started.
    2. The libmcrypt.dll file is missing in the system's system32 (c:windowssystem32) directory. The solution is to find libmcrypt.dll in the php directory, copy libmcrypt.dll to the c:windowssystem32 directory, and then restart the web service.
    3. In the php.ini file in the php directory, the previous ";" in ";extension=php_mcrypt.dll" has not been removed, so the corresponding function cannot be used. The solution is to open the php.ini file and find;extension =php_mcrypt.dll changed to extension=php_mcrypt.dll //Remove the previous one; make it effective
    4. The mysql directory does not have read permissions. The correct directory permissions are as follows:
    administrator Full control
    system Full control
    user Read and run
    Delete all other user permissions (can also be 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 restart the server after modifying this).
    5. If none of the above methods work, use this method: Desktop>My Computer>Right-click Properties>Advanced>Environment Variables>System Variables>New
    Name: phpdir
    Value: c:php (whatever directory your php is in)
    (Reference source: address)

    Second question: "Unable to load mysql extension, please check php configuration"

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

    Third question: "Configuration files now require a top-secret phrase password (blowfish_secret)"

    Make sure you have the correct settings in the config.default.php file:
    $cfg['servers'][$i]['auth_type']= 'cookie';
    At the same time
    $cfg['blowfish_secret'] = 'www.piaoyi.org'; //(Write this value as you like, but cannot leave it blank)

    Actually, I was really depressed when I encountered this problem. If I followed the configuration method I mentioned above, this error should not be prompted. After more than 2 hours of constant modification of the config.default.php configuration file, I kept getting this error, which was almost on the verge of collapse.

    Then I suddenly had an idea: I changed the auth_type authentication method to http, and when I changed it to config, this error always appeared when I opened the page. In other words, changing the authentication mode did not affect phpmyadmin. Could it be? What other configuration files influence phpmyadmin?

    I immediately went to the root directory of phpmyadmin, and I was surprised to find that while there was a config.sample.inc.php file in the root directory, there was also a file config.inc.php! ! And this is the configuration file of the previous old version. It turns out that this file is the trouble. Delete config.inc.php immediately, enter the debugging page again, and the error disappears! Problem solved.

    It seems that the config.inc.php configuration file in the phpmyadmin root directory has a higher priority than the /libraries/config.default.php configuration file. The system calls the configuration file in the root directory first, and then the libraries file. The configuration file in the folder, Ai, I have been struggling with this problem for so long, so sad. It's finally solved, let me breathe a sigh of relief.

    Fourth question: "#2003-Server not responding".

    When encountering this problem, it is most likely that the mysql database has not been started. It is recommended to start mysql directly in: Control Panel-Management Tools-Services. Regarding whether to start, you can check whether there is a process such as "mysqld-nt.exe" in the task manager. If there is, it means that mysql has been started.

    The fifth question: "No php extension setting mbstring found".

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629850.htmlTechArticleThere is nothing to say about the apache server. Try to go to the official website to download the latest one. There is one thing to note: the php tutorial is loaded into the apache container in the form of a module, which is...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn