Recently in the study of Web server development, the first was to use Wamp, then decided to fully configure their own environment, and the entire process recorded. Where Apache is a server, PHP is used to write service-side language, MySQL as a database, phpMyAdmin is a tool to make the database visualization. Below, each step of setting up the environment is recorded.
1. Installing Apache
(1) Download an Apache installation package and unzip it:
(2) Enter the Conf directory and open httpd.conf with Notepad or another text editor to make the following changes:
A. Changing the directory
Note To change the directory where your server is located;
B. If you want to change the server listening port (not necessary):
C. In order to be associated with PHP, at the end of the file add:
There are 283 lines (medium), plus index.php and index.htm (index is the default page to open the server, in other words, to open a page by default, name it index):
(3) in the command line into the Apache24/bin directory, enter the following command to install:
If you want to change the server name, add the-N and parameters later.
(4) The server should have been installed, there are many ways to open the server, you can use the command line, you can also open with Apachemonitor.
Open the browser, enter localhost access, if the page appears, this indicates that the Apache server is installed and running.
2. Configure PHP
(1) Download PHP, unzip, pay attention to the VC version to and Apache matching, my is:
(2) Locate the php.ini-development below the folder, copy one in the current folder, rename it to PHP.ini, open it, and make the following changes:
These are the extension packages to use, because we want to use MySQL, so the Php_mysql.dll and Php_mysqli.dll in front of the semicolon is removed, and later to use what expansion package is also modified here.
Then add the Ext folder under the PHP root folder to the environment variable path (this does not elaborate)
(3) Restart Apache, write a php file in the Htdocs folder, open with a browser, if you can parse successfully, the explanation has been done.
3. Configure MySQL
In fact, this is not necessary how to configure, according to the online tutorial installed on the computer MySQL can, in other words, MySQL configuration is not necessary like PHP configuration and Apache associated.
However, remember to also open the database when you run the server later.
Also, remember to change your username and password.
4. Configure phpMyAdmin
(1) Download the tarball and unzip it in Apache's Htdocs directory:
(2) Open the libraries/config.default.php and modify the following three lines:
$cfg [' Servers '] [$i] [' user ']//change to access the database login name
$cfg [' Servers '] [$i] [' Password ']//change to access the database password
$cfg [' Pmaabsoluteuri ']//change to phpMyAdmin directory path, I phpmyadmin folder in Htdocs directory, using 80 port, I change is
Note that the null password is not allowed to log in, so the default username root and empty password in MySQL can not be used, you need to change the password at MySQL, and then the corresponding here.
(3) In the browser open http://localhost/phpmyadmin/(this and phpMyAdmin folder location, but regardless of location, in the Htdocs directory), the following screen appears:
Enter the user name and password that you just configured, can jump is successful.
5. Summary
After the above steps, apache+php+mysql+phpmyadmin development environment even if it is set up, perhaps some steps will not succeed, because I wrote it by memory.
Now there are development tools that directly package them, such as Wampserver, but I think I can build it all up to make myself understood more, what the framework is, and how they relate to each other.
Through the whole building process, I believe we all have a deep understanding of the relevance of these four things.
At the same time, many of these configurations involved in the configuration files, in the future will still be exposed, such as the creation of virtual domain name, it is necessary to modify the Apache configuration files, but these are later problems. Anyway, you can write the code happily when you build it.
Apache+php+mysql+phpmyadmin Environment Construction