Table of Contents
VC9 x86 Thread Safe (2013-Jun-05 22:49:25)
Home Backend Development PHP Tutorial Winodws 装配 PHP开发环境

Winodws 装配 PHP开发环境

Jun 13, 2016 am 11:27 AM
apache http php windows

Winodws 安装 PHP开发环境

安装环境:Windows7 64位

目标PHP运行环境: PHP5.4和Apache2.4

1,打开PHP windows的官方网站:http://windows.php.net/download/#php-5.5

2,选择Apache作为服务器,PHP5.4 线程安全版。

VC9 x86 Thread Safe (2013-Jun-05 22:49:25)

因为笔者机器上安装了VC9和10没有安装11所以没有选择5.5. php5.5需要安装VC10.可以去添加删除程序里面看你目前安装的Microsoft Visual C++ 20xx Redistributable的版本。如果安装了11可以下载PHP5.5. 或者你自己手动去下载安装个。

?

下载和配置Apache2.4

3,因为我们选择的是PHP5.4所以我们不能使用Apache.org官网的apache,那个只支持VC++ 9.不支持VC++11。另外在你的机器上确定安装了Visual C++ Redistributable for Visual Studio 2012?x86 or x64?

所以我们去http://www.apachelounge.com/download/现在32位或者62位的。笔者是64位win7系统,但是我使用了32位。说明32位兼容64位操作系统。

4,都是免安装版的。直接解压就可以了。

5,启动Apache2前需要配置ServerRoot和DocumentRoot的地址。否则会启动不了。

ServerRoot配置到你的Apache的解压目录。 DocumentRoot配置你的网站地址,或者随便配置个地址,复制Apahce目录/htdocs/index.html文件到配置的那个地址。

6,打开localhost,就可以看到It Works了。

?

配置PHP和Apache

可以参考http://us1.php.net/manual/zh/install.windows.apache2.php

和http://www.cnblogs.com/pharen/archive/2012/02/06/2340628.html

?

1,解析PHP,

LoadModule php5_module "D:/Develop/PHP/php5apache2_4.dll"

AddHandler application/x-httpd-php .php .html .htm

?

2,添加PHP初始化目录。也就是你解压PHP压缩包之后的那个目录PHPIniDir "D:/Develop/PHP"

?

3,添加首页支持PHP文件

DirectoryIndex index.html

      改为

        DirectoryIndex?index.php?index.html

?

PHP部分:

4, 设置PHP扩展包的具体目录,找到

        ; On windows:
        ; extension_dir = "ext"

      改为 (值是ext文件夹的目录)

        ; On windows:
        ? extension_dir = "D:/Develop/PHP/ext"

?

5,开启相应的库功能。

;extension=php_mysql.dll去掉前面的分号(注释),即改为

extension=php_mysql.dll

?

6,设置时区

;date.timezone =

        改为

        date.timezone = Asia/Shanghai

?

PHP文档手册:

http://www.php.net/manual/zh/

?

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated?

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

deepseek web version entrance deepseek official website entrance

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node?

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

How To Set Up Visual Studio Code (VS Code) for PHP Development

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

How do you parse and process HTML/XML in PHP?

Coinsuper exchange software channel official website entrance Coinsuper exchange software channel official website entrance Feb 21, 2025 pm 10:39 PM

Coinsuper exchange software channel official website entrance

See all articles