三步解决搭建PHP环境问题
进行正确的搭建
搭建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环境的配置全部完成。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an
