Apache php mysql Development Environment installation tutorial, apachemysql
A tutorial on building an apache php mysql development environment is provided for your reference.
0. Resource Link:
360 cloud Disk: https://yunpan.cn/c6wpzYwbfmLJY (extraction code: 0190)
1. First install the compiler environment
That is, the following file:
2. install apache + php + mysql
That is, the following file:
2. 1. install apache
2.1.1 Installation
Only key points
2.1.1.1
2.1.1.2
2.1.1.3
2.1.1.4.Enter localhost in the address bar of your browser. If the following page appears, you have installed apache successfully.
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.
Find the apache icon on the desktop and restart apache.
2.1.2.7.
Enter haha.com in the browser and the following page appears:
2. install php
2.2.1 Installation
Right-click the php compressed package and select "decompress File"
2.2.2. Configure php and associate it with apache
2.2.2.1.If php. the ini file is created in the php installation directory. copy the content in ini-development to php and ini and modify
2.2.2.2.Go to the apache installation directory httpd. conf file.
2.2.2.3. Create "a. php" in the blog folder and write the following content:
2.2.2.4. Restart apache
2.2.2.5. Test
Enter haha.com/a.php in the browser.
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 in the php installation directory
2.3.3. Test
Create a file "test_ SQL .php" in the blog File"
2.3.4. Restart apache
2.3.5. Test
Enter haha.com/test_ SQL .php in the browser and the following page is displayed:
2. 4. Getting started with mysql
2.4.1. Connect to the Database Server
2.4.2. Tell the server your character set
2.4.2.1.View 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 recommended that you do not use NotePad to write code when entering SQL statements. Otherwise, the error ERROR1064 may occur.
2.5 configure Sublime Text 2(For details about downloading the software, refer to the cloud disk link at the beginning of this article)
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 point to the real directory of your localhost
2.5.2.PHP syntax installation prompt
Toolbar: Preferences-> Package Settings-> SublimeLinter-> Settings-User
{"sublimelinter": true,"sublimelinter_executable_map":{ "php":"D:\\software\\server\\php5.4\\php.exe"}}
Replace the current address with the php.exe address.
. Problems During Installation
2.6.1.Unable to access localhost
This is because we performed this step before configuring apache.
Solution:
Open the conf \ extra \ httpd-vhosts.conf in the apache installation directory, such as modifying,Remember to restart apache after modification
Remember to restart apache
2.6.2.Sublime Text 2 Chinese Garbled Text
Create a PHP file in Sublime and input echo 'Chinese'. After the file is transferred to the browser, garbled characters are displayed in the browser, and Chinese characters are not displayed normally.
Solution:
Start with the code, that is, <? Add <meta charset = "UTF-8">
3. Change the website root directory
For example, change the website root directory from D: \ software \ server \ apache2.2 \ htdocs to D: \ software \ server \ www.
3. 1. Open the conf \ httpd. conf file in the apache installation directory.
3.1.1
3.2.
3. 2. Modify the apache httpd-vhosts.conf File
3. Restart apache
3. 4. Configure Sublime Text 2
Edit sublime Text/Data/Packages/User/open_broswer.py
<span style="font-size:14px;">url_map = { 'D:\software\server\www' : 'http://localhost/',}</span>
[Note] D: \ www \ should point to the real directory of your localhost
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.