PHP Getting Started: installing the PHP working environment in Windows

Source: Internet
Author: User
Tags what is lamp microsoft iis
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. They are independent programs, but they are often used together, with a higher degree of compatibility, together constitute a powerful Web application

PHP entry: Install the PHP working environment 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 a higher degree of compatibility, together constitute a powerful Web application

PHP Getting Started: Install the PHP working environment 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)

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.