Windows 7 environment installed PHP 5.2.17

1. Download PHP installation package

  a. www.php.net click downloads

  b. Select the windows version of php download

  c. Select the appropriate version to note here is that VC9 IIS is used, VC6 is to use Apache

  d. Select installed version of the program

2. Install PHP5.2.17

  Find online tutorials for most of Zip compression installation package, intended Sajia under study here Why we do not have Installer.

  DOF Installer may be too high, not very good for subsequent manual configuration of it.

  a. Welcome screen, Next

  b. accept the terms, Next

  c. Select PHP installation path of 5.2.17

  d. Select the server you want to install the Web

  e. Select Apache configuration directory (the directory containing the file httpd.conf etc.)

  f. Select the components to be installed, explain here, under the Extensions need to be checked according to their environment, did not install the corresponding program is not checked, so when running PHP error, Sajia not encountered in the subsequent process of using phpmyadmin support bzip2 \ Mcrypt \ Multi-byte String MySQLi and zip error \, so the need to return to the setup in the open extended support these two functions. Incidentally praise the Setup wizard, really well, the method of content modification Do not use those old-fashioned hand of.

  g. confirm, start Install

  h. Installing

  i. installation

3. Configure PHP and Apache

  . A PHP aspects: Since the 2-f has been configured Extensions in Mysql, so there is no need to modify.

  b. Apache aspects :( modify the httpd.conf file Apache directory)

    . i Modify Server root directory: DocumentRoot "XXX" -> DocumentRoot "E: / web" ( Example note backslash n )

    ii. 修改# This should be changed to whatever you set DocumentRoot to处的路径

    iii. 修改LoadModule:

      LoadModule php5_module "php5apache2_2.dll

      --> LoadModule php5_module "C:\Program Files (x86)\PHP\php5apache2_2.dll"

      PHPIniDir ""

      --> #PHPIniDir ""

    iv. 修改DirectoryIndex:DirectoryIndex index.html --> DirectoryIndex index.html index.php

    v. 找到AddType application/x-gzip .gz .tgz 并添加

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

    vi. 保存httpd.conf

4. 测试PHP安装

  a. 在3-b-i中的目录E:/web下建立index.php文件

<?php 
Echo "Hello, World!";
?>

  b. 重启Apache http服务器

  c. 浏览器中输入地址http://localhost/index.php

5. 当当当,成功啦~撒花庆祝哦

转载于:https://www.cnblogs.com/ericsun/archive/2011/07/13/2105674.html

Guess you like

Origin blog.csdn.net/weixin_34290000/article/details/93155015