PHP Getting started: installing the PHP working environment in Windows _ PHP Tutorial

Source: Internet
Author: User
Tags what is lamp microsoft iis
PHP Getting started: install the PHP working environment in Windows. PHP entry: install the PHP working environment in Windows. 1. what is LAMP? Linux + Apache + Mysql + PerlPHPPython is a group of open-source software commonly used to build dynamic websites or servers. PHP entry: install the PHP Working environment separately in Windows.

1. what is LAMP?

Linux + Apache + Mysql + Perl/PHP/Python is a group of open-source software commonly used to build dynamic websites or servers. they are independent programs, but they are often used together, with higher compatibility, a powerful Web application platform is formed together. With the rapid development of open source, open source code LAMP has been integrated with J2EE and. net commercial software has formed a three-pronged trend, and the software development project has a low investment cost in software, so it has received the attention of the entire IT industry. More than 70% of website traffic is provided by LAMP, which is the most powerful website solution.

II. install the Apache server

There are many types of web servers, including Apache server, Lighttpd server, Tomcat server, IBM WebSphere server, and Microsoft IIS. what we want to install today is the most widely used Web server in the world, apache servers with a market share of about 60%.

2.1,: http://httpd.apache.org/

2.2, installation method: http://jingyan.baidu.com/article/0964eca227a0fb8285f536a3.html

III. install MySql database

There are two main ways to install MySql: one is to decompress the version and the other is to install the version. The difference between the two is that some parameters need to be manually configured for the decompressed version. If you need to register an Oracle account for downloading from the official cloud website, you are advised to download one from Baidu.

3.1, extract version of MySql installation method: http://michael-wong.iteye.com/blog/976381

3.2, installation version of MySql installation method: http://wenku.baidu.com/link? Url = response

4. install PHP

Select to download the php-5.2.6-win32.zip version. the reason why the latest version 5.5.7 is not downloaded is that there is no information on the installation method of this version, which is different from the installation methods of the previous versions? So you still need to select this version. of course, you can also try to install the latest version. but for beginners, is it necessary to pursue the new version?

4.1,: http://pan.baidu.com/share/link? Consumer id = 822524062 & uk = 2318720427

4.2. specific installation:

4.2.1 decompress the downloaded file to a directory, such as C: \ lamp \ php5.2.5 \

4.2.2 load php to the apache server as a module:

4.2.2.1 find the httpd. conf file in the conf directory of Apache installation and open it. for example, my file is C: \ lamp \ apache \ conf \ httpd. conf;

4.2.2.2. find Insert a line of code above it and write: loadModule php5_module "c:/lamp/php5.2.5/php5apache2_2.dll". you need to change the path here, if the installation directory is me, you do not need to change it.

4.2.3. what should I do? That is to tell the server what is the suffix of the php file. Only in this way can the apache server know the file to be parsed. php is a suffix.

4.2.3.1. it is still in httpd. in the conf file, find AddType application/x-gzip. gz. this line of tgz code reminds me that if the line of code you find has a # number, it indicates that this line has been commented out and you have to skip this line of code, insert AddType application/x-httpd-php under it. php. phtml

4.2.4. how to specify the location of the php configuration file? Add a line under the code just inserted: PHPIniDir "c:/lamp/php5.2.5". The case sensitivity is actually indifferent. remember to change the path to your own, of course, if the path is the same as mine, you don't have to worry about it.

4.2.5. do you feel that there are many things to be configured? don't worry about it and it will be over immediately. you will be able to see the test page later. I downloaded this version without the php. ini file. Are there any new versions? what should I do? Simple: go to the php installation file and find the php-ini-recyclded file. rename this file to the php-ini file. My address here is: C: \ lamp \ php5.2.5 \ php-ini-recyclded.

Http://www.cnblogs.com/roucheng/

4.3. test whether the installation is successful.

Now we can write a text file (C: \ lamp \ apache \ htdocs \ test.txt) in the htdocs Directory of the apache server installation directory, and write a few codes in this text file:


Phpinfo ();

Just write two sentences of code? Yes, just write it. Save the file and change its suffix to. php.

4.4 start the apache server and start the test program

4.4.1 there are two kinds of startup methods: one is to use its own tool to start, the other is to directly enter net start apache2.2 in the cmd command window and press enter.

4.4.2 open the browser and enter the URL: http: // localhost/press enter to see a line of It works !, It indicates that your service is started normally. Enter http: // localhost/test. php in the address and press Enter. you will find a very beautiful php configuration information page, which proves your success, cool!



4.4.3. do you think the event is over now? Now we only connect the Apache server and php, but php still cannot access the MySql database? It does not exist by default. we must enable it manually.

4.4.3.1. go to the php installation directory (my directory is C: \ lamp \ php5.2.5 \ libmysql. dll), find the libmysql. dll file, and copy it to the C: \ Windows directory. It should be noted that you can also set the environment variable by finding the path in the environment variable, and then adding the path of the php installation directory to the end.

4.4.3.2. now php can find mysql, but we want to extend the mysql connection library by finding php in the php installation directory. ini file and open it, find it in the file; extension = php_bz2.dll this line of code, and insert a line on it: extension_dir = "c:/lamp/php5.2.5/ext ", what does this mean? the location of the extension library installed on my machine is here. The specific location is based on the actual situation on your computer.

4.4.3.3. find the two lines of code extension = php_mysql.dll and extension = php_mysqli.dll in the php. ini file and remove the number before the two lines. This indicates that the function is enabled or enabled. So how can we know whether the correct configuration is successful? It's easy to restart the server immediately, and then visit http: // localhost/test. php again. then you will find the information shown in on the page



5. install php optimization software

Do you think you have too many configurations? it doesn't matter. you can skip this step. after installing this item, you can improve the performance of your php project by 40%. please consider it yourself!

5.1 software name: ZendOptimizer-3.3.3-Windows-i386.zip

5.2,: http://pan.baidu.com/share/link? Required ID = 3641277684 & uk = 1277919049 & fid = 1806952306

5.3. installation method: This version is the next step for installation, so we will not demonstrate it. if you do not know it, Baidu! I have been tired of typing words for too long.

(PHP5.3 began ZendOptimizer officially changed to Zend Guard Loader, (official address: http://www.zend.com/en/products/guard/downloads)

(End)

Purpose 1. what is LAMP? Linux + Apache + Mysql + Perl/PHP/Python is a group of open source software commonly used to build dynamic websites or servers ,...

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.