PHP Development Environment &mysql download installation and configuration process

Source: Internet
Author: User

PHP Development environment &mysql download installation and configuration process

because of the work needs, starting from 0 to learn PHP, a few days after watching video tutorials began to engage in development environment, until today is good. Here is the installation of the configuration process comb share out.

I. Overview

to build a development environment is just a few steps, download---Install---configuration.  PHP environment requires three things, PHP, MySQL,Apache ( in order), according to my understanding, they are language interpreter, database, server . 


Second, download

Php100.com is a magical website, I found the first two things from this, the Apache chain seems to be broken, the official network can not find the download location to search the Internet. Here are the three things.

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

Third, installation

When you're done downloading, you can start.

(1) PHP: This is a green software, extracted to the designated location can be, needless to say.

(2) Apache: Again lai an Apache.


The first place worth saying is here. The last two boxes represent the network domain name and server name, which is not used in the back. The following RadioButton choose 80, but if your 80 port is accounted for by other programs will be selected 8080.


Typical is the default, custom is customized, here is the default.
After installation, you can see an icon in the lower right corner of the screen indicating that Apache has started.

(3) MySQL


Typical can, and then install the part of nothing to say, after the installation of the immediate configuration.



Details configuration or standard configuration? Select the detail configuration (detailed config)


Developer mode or Server mode Ormysql dedicated server mode? The professional degree increases, the performance increases, occupies the resources also to increment, if is the developer own, recommends the choice Developer machine


The second is to support only transactional database, suitable for the application of the database or interactive Web site; The third is to support only non-transactional databases, suitable for easy Web applications, monitoring or logging applications and analytical procedures; The first one is the following two kinds of support, choose this. 

This page is the maximum number of connections for the selected server. First fixed max 20, second maximum 500, third optional.


This page does not move unless your 3306 port is already accounted for.


Select the character set (charset) and decide what encoding format to use for the data stored in the database, I choose the gb2312


Note here that the second check box is strongly recommended so that you can execute the MySQL command from the cmd black box. Others do not move.


Create the initial user, the first is to create a root user, design a password can be, the second is to create an anonymous user, that is, your database can be directly logged in without a username password, not recommended for security purposes. Also, the option under Confirm password is to allow remote connection users to log in with the root account password, depending on the situation.

Iv. Configuration

(1) httpd.conf

First to configure Apache bar, in the apache2.2 directory to find a conf folder, there is a file called httpd.conf, which is the Apache configuration file, to let Apache support PHP, starting from here. Open this. conf file, and from the top down, say


ServerRoot this line to remember your Apache installation location, if you need to remove, you can change it after the move, the following listen 80 means to listen to the 80 port, before the installation of the selected, you can change here.


The most important place here, PHP after extracting the directory will have a Php5apache2_2.dll file, add in the PHP module statement here (for example), Apache can support PHP.


Just like using eclipse to write a Java program to first specify a workspace, here the DocumentRoot is equivalent to a workspace directory, the default htdocs.


Not far down, directory in the directory after the quotation marks represents the system to the Apache to grant search permissions to the directory, so the above workspace (WorkSpace) must be a subdirectory of this directory (or the same). Here the directory can be written a bit larger, I chose the D packing directory.


Here DirectoryIndex refers to workspace under the first find newfile.php if not, to find index.php, have not found index.html.


Here the first line of these two lines is to add a file type of recognition, after the addition of Apache know the extension is. php file, the following phpinidir is given is the path of the INI configuration file PHP, the following also mention this file.


Here are a few of the mistakes worth mentioning. ERROR500 is the system internal script error, refers to the Web page running the program error, Error404 is unable to find the specified page error


Virtual host here is a web hosting, "#" to remove the release of this sentence can open the virtual host. If you do not use a virtual host, you can only enter localhost in the address bar and Apache to find the workspace directory index specified file name, with the virtual host can specify multiple addresses at the same time multiple directories, if you need to debug more files and do not put in a case, Using a virtual host is a good choice.

(2) httpd-vhost.conf

If the virtual host is turned on, this file will be configured in the extra directory under the Conf directory.


This is my configuration (part). Enter the contents of the ServerName in the Address bar, Apache will go to DocumentRoot's address to find Web content. If you want to have multiple servername corresponding to a directory, you can write the other servername in Serveralias.

(3) PHP.ini

The following PHP configuration, this file in the PHP decompression directory, the php.ini-production and php.ini-development two files, one of the "-" and after the contents of the "-" and then into the INI file (this is the two modes, Producers and developers. I removed the-production). Open the


Find this place, put these extension before;


Extension_dir Extended directory path


Default_charset Default Character Set UTF-8


All right, here's the whole installation configuration process, and here's how I'm connected to the database.


<?phpinclude ("conn.php");//Connect Database # $id =str_replace ("", "" ", $_post[' id ']);//Receive client-sent username; $id = ' 0001 '; $sql =" SELECT * from Student where stuid= ' $id ' "; $query =mysql_query ($sql); $rs = Mysql_fetch_array ($query); if (Is_array ($rs)) {# if ($_post[' pwd ']== $rs [' stupwd ']) {if ($rs [' stupwd ']== ' ABCD ') {echo "Login succeed";} else echo "illegal user!";} else echo "no result found!";? >


After a day or more to complete the configuration of success, such as the discrepancy welcome comments. My configuration process 90% is followed by PHP100 video tutorial, but he did not tell php.ini this file, this file I was found on the Internet tutorial, thanks to idiot brother

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

Pictures and texts are original, CSDN first, reproduced please indicate the source





PHP Development Environment &mysql download installation and configuration process

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.