Apache + MySQL + php + phpMyAdmin integration steps

Source: Internet
Author: User
Recently I thought about my own research on a small project and didn't want to use the database on the company's server. So I installed a database locally and wanted to use phpMyAdmin for management. After a few days, I always encountered such a problem, I finally got it ready and found that there were always such flaws in the online tutorials, So I sorted it out and gave it to a cainiao like me for reference.

Recently I thought about my own research on a small project and didn't want to use the database on the company's server. So I installed a database locally and wanted to use phpMyAdmin for management. After a few days, I always encountered such a problem, I finally got it ready and found that there were always such flaws in the online tutorials, So I sorted it out and gave it to a cainiao like me for reference.

Recently I thought about my own research on a small project and didn't want to use the database on the company's server. So I installed a database locally and wanted to use phpMyAdmin for management. After a few days, I always encountered such a problem, I finally got it ready and found that there were always such flaws in those tutorials on the Internet, so I sorted it out and gave it to a cainiao like me for reference, it is also convenient to see it if you forget it again!

Not to mention nonsense. The first tools required are the Apache, PHP, MySQL, and phpMyAdmin installation packages. You can download them from the corresponding official website. The official website address is not provided here.

Step 1: install Apache and MySQL. The establishment of the integrated environment of Apache + MySQL + php + phpMyAdmin mainly involves the configuration of Several configuration files. Here, the configuration steps for Apache and MySQL are different. There are detailed installation tutorials on the Internet. However, it is recommended that all of them be installed in one disk for easy search.

Step 2: install PHP, download the corresponding installation package from the official website, decompress it to the disk to be installed, and rename it php.

Step 3: now we have started the integrated configuration of Apache + MySQL + PHP. First, find the httpd. conf file in the conf folder under the Apache installation directory and open it with notepad and other editing tools.

Find the DocumentRoot "E:/Apache2.2/htdocs" line, set the website root directory, and then find , Set the value to the same as DocumentRoot.

Open install.txt in the PHP installation directory and find

# For PHP 5 do something like this:

LoadModule php5_module "c:/php/php5apache2. dll"

AddType application/x-httpd-php. php

# Configure the path to php. ini

PHPIniDir "C:/php"

Copy these lines and paste the path under mod_ssl.so In the httpd. conf file under the Apache installation directory to your PHP installation path. Php5apache2. the dll file can be found in the PHP installation directory, such as php5apache. dll, php5apache2_2.dll file, which corresponds to the Apache version installed with you. If you install Apache 2.2, set php5apache2. change the dll to php5apache2_2.dll.

Add the following two lines in the AddType section of httpd. conf.

AddType application/x-httpd-php. php

AddType application/x-httpd-php. html

Now apache can parse php, find DirectoryIndex, add index. php, and restart the server.

Since PHP has a lot of content that requires loading the relevant extension library to run, it is necessary to make simple settings for PHP to meet the requirements of practical applications. To make PHP load the corresponding extension library, you need to modify the PHP configuration file php. ini. This file is the core file of PHP configuration. Find the PHP. ini-development file in the php installation directory and rename it php. ini. Open this file in a text editor. To load an extension library, you need to find a line like this. The Code is as follows:; extension = php_gd2.dll remove the semicolon at the beginning of the line and save the file. Remove the following rows. Save the file.

Extension = php_curl.dll

Extension = php_gd2.dll

Extension = php_mbstring.dll

Extension = php_mysql.dll // mysql extension library available

Extension = php_mysqli.dll

Extension = php_pdo_odbc.dll

Find extension_dir = "", write the path as "E: \ php5.3.5 \ ext" (Your PHP installation path), remove the previous one, and save the file.

If the extension library cannot be used for such modification, you can find the path of the extension library file in PHP in two ways.

1. Copy the DLL files of the corresponding extension Library (these files are stored in the EXT directory under the PHP installation directory) to the system directory (c: \ windows \ system32.

2. modify the system environment variables and set the c: \ php \ ext directory to the system environment path. (The path is the ext folder in the PHP installation path.) After the PHP configuration is complete, restart the computer.

The next step is to install phpMyAdmin. decompress the downloaded phpMyAdmin package to the folder corresponding to ducumentRoot in the Apache configuration file (my default htdocs is here) and rename it phpMyAdmin, restart the server. Enter http: // 127.0.0.1/phpMyAdmin/index. php in the address bar. The phpMyAdmin working interface indicates that the installation is successful.

You may encounter any problems during the installation process according to what I wrote. I will write detailed solutions to the problems I encountered in the steps (such as incorrect version, unable to load the extension library ). In addition, phpMyAdmin also needs to have some configuration in config. default. php. It is not clear to me. You can refer to the specialized phpMyAdmin tutorial. However, it doesn't matter. It needs to describe the configuration. If you don't have a configuration, you will be prompted.

After talking about this, there are not many configuration items in total, but in my opinion, the configuration files are all in English, so they are not easy to understand. Search is the only way to quickly find the desired item. This type of sorting is not very well organized for the first time, and I hope it will help you. I can understand it.

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.