PHP development environment & amp; MySQL download and installation and configuration process

Source: Internet
Author: User
Tags mysql download php development environment
PHP development environment MySQL download and installation and configuration process for work needs, from 0 to learn PHP, a few days ago after watching the video tutorial began to develop the environment, it is good to today. Here we will sort out the installation and configuration process. 1. The overview is just a few steps to build a development environment. Download, install, and configure. The PHP environment requires three things: php and mysq.

PHP development environment MySQL download and installation and configuration process for work needs, from 0 to learn PHP, a few days ago after watching the video tutorial began to develop the environment, it is good to today. Here we will sort out the installation and configuration process. 1. The overview is just a few steps to build a development environment. Download, install, and configure. The PHP environment requires three things: php and mysq.

PHP development environment & MySQL download and installation and configuration process

Because of work needs, I started to learn PHP from 0. I started to develop the environment after watching the video tutorial a few days ago. It's good to do it today. Here we will sort out the installation and configuration process.

I. Overview

To build a development environment, you just need to download, install, and configure it. The PHP environment requires three things: php, mysql, and apache (in order, for example). According to my understanding, they are language interpreters, databases, and servers.


Ii. Download

PHP100.com is a magic website. I found the first two things on it. The apache chain seems to be broken, and I searched the internet without finding a download location on the official website. The following three things are provided.

http://windows.php.net/downloads/releases/php-5.4.31-Win32-VC9-x86.ziphttp://10.224.254.1/files/7228000000C5A56E/cz.jz123.cn:898/soft/mysql-5.5.28-win32.ziphttp://www.crsky.com/soft/1368.html#down

Iii. Installation

After downloading, start installing.

(1) php: This is a green software. You can extract it to the specified location.

(2) apache: install apache again.


The first thing worth mentioning is here. The above two boxes respectively represent the network domain name and server name. If you write them randomly, they will not be used later. You can select 80 for the following radiobutton, but if your port 80 is occupied by other programs, you need to select 8080.


Typical is the default value, and m is the Custom value. The default value is used here.
After installation, you can see an icon in the lower-right corner of the screen, indicating that apache has been started.

(3) mysql


Typical. There is nothing to say about the installation part. configure it immediately after installation.



Detailed configuration or standard configuration? Detailed Configuration)


Developer mode or server mode orMysql dedicated server mode? The Professional level increases, the performance increases, and the resource usage increases. If you are a Developer, we recommend that you select Developer Machine.


The second is to support only transactional databases, suitable for application databases or websites with strong interactivity. The third is to support only non-transactional databases, it is suitable for simple web applications, monitoring or log applications, and analysis programs. The first one is supported by either of the following.

This page is the maximum number of connections to the selected server. The first is a fixed maximum of 20, the second is a maximum of 500, and the third is a choice.


This page does not need to be moved unless you have occupied port 3306.


Select the character set to determine the encoding format of the data stored in the database.


Note that we strongly recommend that you select the second check box so that you can execute the mysql command from the cmd black box. Other actions are not required.


Create an initial user. The first is to create a root user, and design a password. The second is to create an anonymous user. That is to say, your database can directly log on without a password, this item is not recommended for security reasons. In addition, confirm the password. The option below is to allow the remote connection user to log on with the root account and password, depending on the situation.

Iv. Configuration

(1) httpd. conf

Configure apache first. Find a conf folder named httpd in the directory apache2.2. conf file. This is the apache configuration file. To make apache support php, start from here. Open the. conf file and go down from top to bottom.


The ServerRoot line indicates your apache installation location. If you need to remove it, you can change it here after moving it. The Listen 80 below indicates the listening port 80, which was previously selected during installation, you can change it here.


The most important thing is here. After php is decompressed, A php5apache2_2.dll file will be found in the directory, and the statements added to the php module will be written here (for example). apache will be able to support php.


Just as you need to specify a WorkSpace before using eclipse to write a java program, the DocumentRoot here is equivalent to a WorkSpace Directory, which defaults to htdocs.


Not far down. The Directory enclosed in the Directory quotation marks indicates the Directory in which the system grants the search permission to apache. Therefore, the preceding WorkSpace must be a subdirectory (or the same) of the Directory. Here the directory can be written a little larger, and I chose the root directory of the d disk.


In this case, directoryindexrefers to finding newfile.php in workspacefirst. If not, go to index.php, and find index.html again.


The first line of the two lines is to add a file type recognition. After adding the lines, apache recognizes that the extension is. php file; PHPIniDir below shows the path of the php ini configuration file, which will be mentioned below.


These errors are worth mentioning. Error500 is a script error in the system. It indicates that the program running on the webpage has an error. Error404 indicates that the specified webpage cannot be found.


The Virtual Host here is a Virtual Host. You can enable the Virtual Host by removing. If you do not need a VM, you can only enter localhost in the address bar and then apache will find the file name specified by Directory Index in the bucket. If you use a VM, you can specify multiple addresses for multiple directories at the same time, if you need to debug a large number of files and do not place them in one place, using a VM is a good choice.

(2) httpd-vhost.conf

If the VM is enabled, You need to configure this file, which is in the extra directory under the conf directory.


This is my configuration (partial ). Enter ServerName in the address bar, and apache will go to the DocumentRoot address to find the webpage content. If you want multiple servernames to correspond to one directory, you can write other servernames in ServerAlias.

(3) php. ini

Next, we will configure php. This file is in the php decompress directory and php. ini-production and php. ini-development the "-" of one of the two files and the removed content become an ini file (these two modes are producer and Developer. -Production ). Open it


Find this location and remove the ones before the extension.


Extension_dir extension directory path


Default Character Set UTF-8


Well, the entire installation and configuration process is like this. The following figure shows my connection to the database.


 


After more than one day, the configuration was successful. If you have any questions, please comment and correct them. My configuration process 90% was followed by the PHP100 video tutorial, but he didn't talk about the php. ini file. I found this file online for the tutorial. Thank you, silly brother.

Http://www.cnblogs.com/homezzm/archive/2012/08/01/2618062.html





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.