Apache PHP MySQL Development environment Installation Tutorial _php instance

Source: Internet
Author: User
Tags apache php php mysql
Apache PHP MySQL Development environment Building tutorial, share to everyone, for your reference

0. Resource Links:

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

1. Install the compiler environment first

such as the following file:

2. Installing Apache+php+mysql

such as the following file:


2.1. Installing Apache

2.1.1 Installation

Just the key points.

2.1.1.1


2.1.1.2


2.1.1.3


2.1.1.4. in the browser address bar type: localhost, if the following page appears, you have successfully installed Apache


2.1.2. Configuring Apache

2.1.2.1


2.1.2.2


2.1.2.3. Go to conf\extra\httpd-vhosts.conf under Apache installation directory


2.1.2.4. Modifying the system's Hosts file


2.1.2.5.


2.1.2.6.

Desktop to 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 tarball and select "Unzip file"


2.2.2. Configuring PHP, associating with Apache

2.2.2.1. If the php.ini file does not exist, create a new file in the PHP installation directory Php,ini, copy the contents of the file Php.ini-development in the PHP installation directory to Php,ini, and modify


2.2.2.2. entering 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. Restarting Apache

2.2.2.5. Testing

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 Modifying the INI file in the PHP installation directory


2.3.3. Testing

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


2.3.4. Restarting Apache

2.3.5. Testing

In the browser input haha.com/test_sql.php, display the following page


2.4. Get started with MySQL

2.4.1. Connecting to a 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 errors may occur ERROR1064

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

2.5.1. editing 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. Installing PHP Syntax tips
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 your actual php.exe address.

2.6. Problems that occur during installation

2.6.1. Unable to access localhost

is because we performed this step before we configured Apache.


Workaround :

Open Apache installation directory conf\extra\httpd-vhosts.conf, such as modified, 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 '; After you go to the browser, the browser appears garbled and does not display Chinese correctly.

Workaround:

At the beginning of the code, that is, <?php before adding

3. Change the site root directory

For example, change the site root directory from the previous 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.3. Restart Apache

3.4. Configuring Sublime Text 2

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

Url_map = {' D:\software\server\www ': ' http://localhost/',}

Note D:\\www\\ should be the real directory that your localhost points to

The above is the whole content of this article, I hope that everyone's learning has helped, but also hope that we support the script home.

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