How to configure PHP

Source: Internet
Author: User
Tags win32 installer
1. Unzip the downloaded PHP 5 zip package directly, and I will extract the PHP 5.2.4 zip file directly under the d:\php directory. Installing PHP does not recommend using the Win32 Installer (mainly for later installation extension trouble).

2. In the Explorer, enter the PHP installation directory, copy php.ini-dist or php.ini-recommended, and name it php.ini. Then open php.ini.

3. Find:

; Extension=php_mysql.dll

To be in front of; The number is removed and changed to:

Extension=php_mysql.dll

4. Find:

Extension_dir = "./"

Change it to the absolute path of your ext subdirectory in your PHP installation directory. For example, my:

Extension_dir = "d:/php/ext/"

This step is important. Otherwise, PHP will not find the Php_mysql.dll module and cannot be loaded.

5. In the "Control Panel", "System", "Advanced", "Environment variables", in the "system variables" found path, edit the value of the path variable, add your PHP directory D:\php, before you must use a semicolon (;) it and the preceding values are separated.
5. Configure Apache and PHP

Open the httpd.conf file in the Conf subdirectory of the Apache installation directory.
1. Find:

DocumentRoot "xxxxxxx"

A directory that changes to the content of your local site. For example, my:

DocumentRoot "E:/web"

After the change, pull down a little, find "# This should is changed to whatever you set DocumentRoot to." And change the place below.

2. Locate LoadModule, and add these two lines in the following blanks, based on your PHP installation directory:

LoadModule php5_module "D:/php/php5apache2_2.dll"
Phpinidir "d:/php"

3. Find:

DirectoryIndex index.html

Modified to:

DirectoryIndex index.php index.html

4. Find:

AddType application/x-gzip. gz. tgz

Add these two lines:

AddType application/x-httpd-php. php
AddType application/x-httpd-php. html

5. Save httpd.conf

  • Related Article

    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.