Apache PHP MySQL Development environment Installation Tutorial _php instance

Source: Internet
Author: User
Tags apache php install php php file php mysql sublime text

The Apache PHP MySQL development environment constructs the course, shares to everybody, for everybody reference

0. Resource Links:

360 Cloud Disk: Https://yunpan.cn/c6wpzYwbfmLJY (extract code: 0190)

1. First install the compiler environment

The following document:

2. Install Apache+php+mysql

The following document:


2.1. Install Apache

2.1.1 Installation

Just a few key points.

2.1.1.1


2.1.1.2


2.1.1.3


2.1.1.4. in the browser address bar input: localhost, 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 for the system


2.1.2.5.


2.1.2.6.

Desktop find Apache icon, restart Apache


2.1.2.7.

In the browser input: haha.com, the following page appears


2.2. Install PHP

2.2.1 Installation

Right-click the PHP compression package and select "Extract Files"


2.2.2. Configuring PHP, associating with Apache

2.2.2.1. If no php.ini file exists, 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. Enter 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

In the browser input haha.com/a.php, 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 in the PHP installation directory


2.3.3. Test

Create a new file in a blog file "test_sql.php"


2.3.4. Restart Apache

2.3.5. Test

Enter haha.com/test_sql.php in the browser to display the following page


2.4. mysql

2.4.1. Connecting to a database server


2.4.2. Tell the server your character set

2.4.2.1. View method, right click on DOS window, select "Properties"


2.4.2.2. Use this command to set the character set:setnames xxx;


2.4.3. It is best not to write code in Notepad when you enter SQL statements, or you may receive errors ERROR1064

2.5 configuration Sublime Text 2 (Download the software please refer to the first Cloud disk link)

2.5.1. Edit Sublime text/data/packages/user/open_broswer.py

Url_map = {' D:\\software\\server\\apache2.2\\htdocs ': ' http://localhost/',}

Attention D:\\www\\ should be the real directory for your localhost point

2.5.2. Installing PHP syntax hints
Toolbars: Preferences->package Settings->sublimelinter->settings-user

{' Sublimelinter ': true, ' Sublimelinter_executable_map ': {  ' php ': ' D:\\software\\server\\php5.4\\php.exe '}}

Replace the address above with your actual php.exe address.

2.6. Problems during installation

2.6.1. Unable to access localhost

It's because we did this step before we configured Apache


Workaround :

Open the Apache installation directory conf\extra\httpd-vhosts.conf, as shown in the following image changes, Remember to restart Apache


Remember to restart Apache.

2.6.2.Sublime Text 2 Chinese garbled problem

Create a new PHP file in sublime and enter Echo ' Chinese '; Go to the browser, the browser appears garbled, does not display the normal Chinese.

Workaround:

Add <meta charset= "Utf-8" Before the code begins, that is <?php >

3. Change the site root directory

For example, change the site root directory from previous D:\software\server\apache2.2\htdocs to D:\software\server\www

3.1. Open the conf\httpd.conf file under the Apache installation directory

3.1.1


3.2.


3.2. Modify Apache httpd-vhosts.conf files


3.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>

Attention D:\\www\\ should be the real directory for your localhost point

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Related Article

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.