Home > php教程 > php手册 > php 环境配置(windows环境)

php 环境配置(windows环境)

WBOY
Release: 2016-06-13 09:37:28
Original
793 people have browsed it

一、下载apache_2.2.8-win32-x86-no_ssl (1).msi、php-5.2.5-Win32.zip。链接:

二、创建如下目录:注意不要空格

F:\apache

三、安装apache到。安装完成后在浏览器输入127.0.01, 提示it works说明安装成功。注意安装前必须卸载iis

F:\apache\Apache2.2

四、解压php到

F:\apache\php

五、将F:\apache\php\php.ini-dist 重命名为 F:\apache\php\php.ini

六、打开F:\apache\php\php.ini。找到字符串:extension=php_gd2.dll所在行(611行),去掉行首的分号,在接下来的几行里,找到下表中列出的模块所在行,同样去掉前面的分号。

extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mhash.dll
extension=php_mime_magic.dll
extension=php_ming.dll
extension=php_mysql.dll

七、将F:\apache\php和F:\apache\php\ext加入系统环境变量

八、在F:\apache\Apache2.2\htdocs下创建一个first.php文件。文件内容如下



PHP 测试


Hello World'; ?>


九、在浏览器输入http://127.0.0.1/first.php。发现显示的是html源代码。所以打开F:\apache\Apache2.2\conf\httpd.conf.

在125行(找到这两句#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so 在这两句先加入下面两句话)

1.
LoadModule php5_module "F:/apache/php/php5apache2_2.dll"
PHPIniDir "F:/apache/php/"

2.在383行添加一行

AddType application/x-httpd-php .php

十、重启php服务器。在浏览器输入http://127.0.0.1/first.php。出现helloWorld。即成功

Related labels:
source:php.cn
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template