How to build apache php mysql Development Environment
Editor to share with you how to build the apache php mysql development environment, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
0. Resource links:
360Cloud disk: https://yunpan.cn/c6wpzYwbfmLJY (extraction code: 0190)
1. First install the compiler environment
That is, the following files:
two。 Install apache+php+mysql
That is, the following files:
2.1. Install apache
2.1.1 installation
Just say a few key points.
2.1.1.1
2.1.1.2
2.1.1.3
2.1.1.4. Enter: localhost in the browser address bar, and if the following page appears, you have successfully installed apache
2.1.2. Configure apache
2.1.2.1
2.1.2.2
2.1.2.3. Enter conf\ extra\ httpd-vhosts.conf under the apache installation directory
2.1.2.4. Modify the hosts file of the system
2.1.2.5.
2.1.2.6.
The desktop finds the apache icon and restarts apache
2.1.2.7.
Type: .com in the browser, and the following page appears
2.2. Install php
2.2.1 installation
Right-click the php package and select "extract File"
2.2.2. Configure php, associate with apache
2.2.2.1. If the php.ini file does not exist, create a new file php,ini in the php installation directory, copy the contents of the file php.ini-development in the php installation directory to php,ini, and modify
2.2.2.2. Go to the apache installation directory httpd.conf file
2.2.2.3. Create a new "a.php" in the blog folder and write the following
2.2.2.4. Restart apache
2.2.2.5. test
Enter .com/a.php in the browser and the following page appears
2.3. Install mysql
2.3.1 installation
2.3.1.1
2.3.1.2
2.3.1.3
2.3.1.4
2.3.1.5
2.3.1.6
2.3.2 modify the ini file under the php installation directory
2.3.3. test
Create a new file "test_sql.php" in the blog file
2.3.4. Restart apache
2.3.5. test
Enter .com/test_sql.php in the browser to display the following page
2.4. Get started with mysql
2.4.1. Connect to the database server
2.4.2. Tell the server your character set
2.4.2.1. To view the method, right-click the dos window and select Properties.
2.4.2.2. Use this command to set the character set: set names xxx
2.4.3. It is best not to use notepad to write code when entering sql statements, otherwise an error ERROR1064 may occur
2.5 configure Sublime Text 2 (please refer to the link to the cloud disk at the beginning of the article to download the software)
2.5.1. Edit sublime Text/Data/Packages/User/open_broswer.py
Url_map = {'D:\\ software\\ server\\ apache2.2\\ htdocs': 'http://localhost/',}
[note] D:\\ www\\ should be the real directory that your localhost points to
2.5.2. Install PHP syntax prompts
Toolbar: Preferences- > Package Settings- > SublimeLinter- > Settings- User
{"sublimelinter": true, "sublimelinter_executable_map": {"php": "D:\\ software\\ server\\ php5.4\\ php.exe"}}
Replace the address above with the address of your actual php.exe
2.6. Problems during installation
2.6.1. Unable to access localhost
Because we performed this step when we configured apache before.
Solution:
Open conf\ extra\ httpd-vhosts.conf in the apache installation directory, and modify the figure below. Remember to restart apache after modification
Remember to restart apache
2.6.2.Sublime Text 2 Chinese garbled code problem
Create a new php file in Sublime and enter echo 'Chinese'. After going to the browser, the browser appears garbled and does not display Chinese normally.
Solution:
At the beginning of the code, that is,