search
Homephp教程php手册三步解决搭建PHP环境问题

三步解决搭建PHP环境问题

Jun 13, 2016 am 11:10 AM
apachephponedownloadInstallbuildcorrectenvironmentofsolveconductquestion

进行正确的搭建

搭建PHP环境一、安装Apache 2.2.x

下载地址:http://httpd.apache.org/

一路回车即可安装。 注意安装完成后要执行:D:Apache2.2bin>httpd -k install

假设,安装在D:盘下。

Installing the Apache2.2 service
The Apache2.2 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd: Could not reliably determine the server's fully qualified domain name, us
ing 192.168.28.100 for ServerName

执行后,在桌面右下脚打开Monitor Apache Servers 并启动Apache 2.2服务

搭建PHP环境二、安装PHP

下载地址:http://cn2.php.net/get/php-4.4.9-Win32.zip/from/a/mirror

下载 php-5.2.6-Win32.zip

(1)将PHP文件解压到一个目录下,目录地址为 "D:php"。
(2)将PHP目录(D:php)下的php.ini-dist复制到windows(有的系统是winnt目录)目录下,并改名为php.ini。
(3)复制D:php目录下的所有dll文件到windows的系统文件夹里,即:C:windowssystem32。

注意:如果不想复制(3)的文件,可以把 D:php 目录加入系统PATH变量中

搭建PHP环境三、Apache 与 PHP 的整合

开始菜单的程序的Apache HTTP Server 2.2.4,再进入下一级的Configure Apache Server,这时可以看到那个Edit the Apache httpd.conf Configuration File。点一下。
查找:
#LoadModule ssl_module modules/mod_ssl.so
在下面添加:
LoadModule php5_module "d:/local/php/php5apache2_2.dll"
查找:
DirectoryIndex index.html
替换:
DirectoryIndex index.html index.htm index.php default.php
查找:
AddType application/x-gzip .gz .tgz
在下面添加:
AddType application/x-httpd-php .php
Apache配置结束,现在开始进行PHP配置,用Notepad打开C:windowsphp.ini。
查找:
extension_dir = "./"
替换:
extension_dir = "d:/local/php/ext/"
查找:
upload_max_filesize = 2M
这里的意思为修改上传文件的最大限制,默认为2M,可以改为6M。
查找:
;extension=php_mbstring.dll
将前面的;号去掉。
查找:
;extension=php_gd2.dll
将前面的;号去掉。
查找:
;extension=mysql.dll
将前面的;号去掉。
查找:
;date.timezone =
替换:
date.timezone = PRC
文件修改完毕,此时,双击右下角任务栏的Apache图标,弹出的窗口中,点Stop停止服务,等停止后再点Start启动服务,此时,可以看到其窗口的状态栏中会显示:"Apache/2.2.4 (Win32) PHP/5.2.0"。搭建PHP环境的配置全部完成。


Statement
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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools