A detailed explanation of PHP configuration in Windows environment

Source: Internet
Author: User
Tags file size ini php programming

After a period of frenzied PHP programming, the configuration of PHP under the Windows platform is a deep feeling, at first I used a button to install the fool bag, but consider the installation version of the Fool package has been behind, in the real manual configuration of the PHP environment encountered many problems, after consulting a lot of information and try, Finally configured successfully. Now, I will be my configuration experience and share with you, I believe you can solve the configuration of the PHP environment of confusion.

First of all, I use the software version.

PHP 5.1.6

Apache 2.0.59 (Note: Apache 2.2.X version above to add Plug-ins to support PHP 5)

MYSQL 5.0.24a

OK, now start the installation, I installed the PHP5, directly unzip the file to C:\php (installed to where there will be no impact, with personal hi, all the paths in this article to my installation path, please install on their own machine when the attention to modify their own path), and then install Apache, I put it directly into the C-packing directory, in the installation process, there will be 3 text boxes, above two input your native IP, the bottom of the input of your email, OK. Installation completed. Edit Now ... \apache group\apache2\conf\ under the httpd.conf file. Open the file in Notepad and add the last two lines of code:

LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php .php

I set up a www directory in the C:\ directory to store My site files, in httpd.conf find such a word: DocumentRoot "c:/apache2/htdocs" changed to DocumentRoot "c:/www." In this way, the home directory is set to C:\www. If you do not want to change the home directory location, you may not change this item.

To modify the default home page for a directory:

Find DirectoryIndex behind the file name you want to set the home page, such as: index.html index.php.

Language priority, locate the following statement

Languagepriority zh-cn ZH-TW en ca cs da de el eo et fr he hr it ja ko ltz nl nn no pl pt pt-br Ru SV put Chinese (zh-cn zh-tw) Part of the cut is put to the front (that is, change the corresponding part of the original file as above.)

There's nothing else to change. Apach's configuration is here. Then talk about the configuration of PHP.

Copy the php.ini-dist to the C:\windows under the name php.ini (installed PHP have done it) and then modified a few places:

Find post_max_size = 8M under Data handling

This is the maximum size of post data that PHP will accept, and can be changed to 20M.

Find extension_dir= under Paths and directories

Here is the location of the PHP Search extension library, set its path to the location of the Extensions folder, which is changed to:

Extension_dir= "C:\php\ext"

Upload_max_filesize = 2M is found under file uploads to allow maximum file size to be uploaded

Can be changed to 20M.

Dynamic extensions This is the PHP extension Settings section, which lists all of the support extensions for PHP, preceded by a semicolon annotation, indicating that the current PHP configuration does not support scaling, We can remove the semicolon and let PHP support it. The extensions listed below are several common and more useful PHP extensions to remove the semicolon before the following sentences

;extension=php_mbstring.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_imap.dll
;extension=php_mysql.dll

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.