Windows下配置Apache2(IIS)+PHP5+MYSQL6+Zend
Windows 下配置 Apache2(IIS)+PHP5+MYSQL6+Zend 一、 下载地址 : Apache2.0.63 : http://archive.apache.org/dist/httpd/ PHP 5.2.6 : http://cn2.php.net/get/php- 5.2.6 -Win32.zip/from/a/mirror MYSQL 6.0.3 : http://dev.mysql.com/downloads/mysql
Windows下配置Apache2(IIS)+PHP5+MYSQL6+Zend
一、下载地址:
Apache2.0.63 :http://archive.apache.org/dist/httpd/
PHP
MYSQL
软件的安装安装顺序就是上面列出来的顺序,其中只有PHP的是zip包,直接解压就可以了。 Zend最后安装,等所有的运行都没问题后才装的。
二、安装配置过程:
(一) Apache(IIS)
Apache 的安装很简单,我就直接把他装到了D:/program/apache2下,一路NEXT,同意许可协议后会有填写服务器信息的页面,因为是本地调试,network domain和servername两项都填localhost,最后那项administrator's email address填我自己的邮件地址,继续NEXT,直到FINISH;完成之后Apache会启动相关服务,并在任务栏右下角运行一个Apache监控器,可测试Apache是否安装成功:打开浏览器,输入http://localhost/,页面显示“It Works!”,表示Apache安装OK了~安装完后我的apache目录就是D:/program/apache2 .
如果选用iis服务器,这里安装IIS,其他的安装步骤不变。
(二)PHP
直接解压缩放到D:/program/php目录下,这样查找文件会方便许多。
(三)Mysql:
直接装到D:/program/mysql下.安装完成后,打开 cmd 命令提示符窗口,输入命令:MySQL –u root –p 输入密码后,如果能够正常进入 MySQL 控制台则说明 MySQL 安装正常。
经测试把数据库文件单独放一个目录可以提高数据库访问速度,下面更改MySQL 数据库目录,此步骤不是必须的。
a) 打开 cmd 命令提示符窗口,输入命令:net stop MySQL 停止 MySQL 服务运行;
b) 打开D:/program/MySQL/my.ini
找到:
Datadir = "D:/program/MySQL/data"
修改为:
Datadir = "D:/Database"
c) 将D:/program/MySQL/data 文件夹复制到D:/,并重命名为D:/Database;
d) 打开 cmd 命令提示符窗口,输入命令:net start MySQL 启动 MySQL 服务。
e) 重新测试 MySQL 是否工作正常。
(四)配置
一.配置Apache
1.加载php模块
把PHP直接作为apache的一个模块运行,在http.conf文件加入:
LoadModule php5_module "D:/program/php/php5apache2.dll"
AddType application/x-httpd-php .php
2.修改网站目录
在D:/program目录下建立了一个www的目录用于存放我的站点文件,在http.conf里改:
把DocumentRoot "D:/program/Apache2/htdocs"改成了DocumentRoot "D:/program/www"
3.修改列出目录属性(可选)
Apache2.0.x于1.3.x相比2.0.x默认不能直接列目录,就改了:
把
Options FollowSymLinks
AllowOverride None
改为:
Options Indexes FollowSymLinks
AllowOverride None
把apache的默认字符设置为中文简体:
AddDefaultCharset GB2312
4. 修改目录的默认首页:
DirectoryIndex 后面写上你想设置为首页的文件名,如:index.html index.php等
注意一点的是,要使这些配置生效需要重新启动apache
二.配置PHP php.ini
1,把php.ini-dist复制到C:/windows 下改名为 php.ini
2,然后修改了几个地方:
找到:extension_dir = "./"将其改为extension_dir = " D:/program /php/ext" (指定动态连接库的目录,php5和php4不同的地方就是它的动态连接库目录变了,这在它的文档结构里有详细的说明)。
3, 找到:Windows Extensions
在 Windows Extensions 下方的动态模块配置中,需要打开以下模块支持:(去掉模块配置每行前面的;号即可)
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_MySQL.dll
4,接下来修改了一些文件上传以及内存使用最大限制:
memory_limit =
post_max_size =
upload_max_filesize =
别的就没改什么了,这里修改过php.ini以后也要重新启动apache
5 找到:
disable_functions =
改为:
disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open, proc_get_status, ini_alter ,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog, readlink,symlink,popepassthru,stream_socket_server
6 保存 php.ini 文件,并将其复制到 C:/Windows/
接下来一点很重要的就是把php目录下的 libmysql.dll 和 libmysqli.dll 复制到windows/system32下,如果不这样做,mysql动态连接库就无法正常加载。
三.IIS配置(可选)
如果选择IIS,在这里完成iis的配置。下面介绍iis的配置流程:
(1) 启动 IIS 管理器,并新建一个网站(虚拟主机)
(2) 输入网站名称,改名称仅为 IIS 中的标识,可任意输入。
(3) 网站IP地址不用填写,端口如没有特殊要求则保持 80 即可,最后正确输入网站域名。
(4) 在网站分区中建立 wwwroot 以及下级站点文件夹 bbs。
(5) 对于 PHP 应用,需要给予该站点"读取"和"运行脚本"的权限
(6) 至此,已经成功的新建了一个站点
IIS 与 PHP 的整合配置 - 使站点支持 PHP
(1) 打开刚刚建立的网站属性 ,在站点属性窗口中,单击"主目录"页签,单击"配置"按钮,在新弹出的"应用程序配置"对话框中,单击"添加"按钮,加入 PHP 的 ISAPI 支持,选择可执行文件:D:/program/PHP/php5isapi.dll 、扩展名为 .php 、限制动作为:GET,POST 。单击"确定"添加,并在"应用程序配置"窗口中查看 .php 扩展是否加载成功。若成功,则单击"确定"关闭配置窗口,回到站点属性主窗口。
(2) 单击"文档"页签,在默认内容文档中添加 index.htm、index.html、index.php 三个文件,并将所有默认文档排序,顺序按照下图所示。完成后,单击"确定",关闭站点属性配置窗口,回到 IIS 管理器主界面。
(3) 右键单击"Web 服务扩展",添加 PHP 扩展支持。
(4) 在如下图所示的"新建WEB服务扩展"对话框中,"扩展名"填写PHP,"文件"选择D:/program/PHP/php5isapi.dll ,并设置该PHP扩展默认为允许。
(6) 重启 IIS 服务,即可。
(五)Zend
现在Apache和PHP都已经配置好了,重新启动Apache服务器,用编辑器编写如下语句:
phpinfo(); ?>;
保存文件名为“phpinfo.php”到用户主目录(本例为d:/program/www)目录,然后打开浏览器,浏览:http://localhost/ phpinfo.php,出现PHP基本信息就说明配置成功。
所有的调试都正常后我把Zend装到了D:/program/zend下 ,双击下载的 ZendOptimizer-
(1) 在安装过程中提示 php.ini 的位置是,注意观察是否为 C:/Windows ,如果不是必须手动指定为 C:/Windows ;Zend Optimizer 安装完成后会自动重启 Apache 服务,重启完成后需要再次打开IE浏览器窗口,查看 phpinfo.php 支持信息,观察是否包含了 Zend Optimizer 支持信息,如果没有,则说明 Zend Optimizer 没有安装成功!
最后,修改 php.ini 文件,将 phpinfo 函数加入到 disable_functions 中。
后记:本文详细介绍了在windows环境下php服务器的配置,我为了安装discuz论坛,而写下此文,但是在安装discuz论坛时,一到创建mysql数据库apache就报错,内存不能读,郁闷了好久,最后我发现我是把mysql安装目录下的libmysql.dll复制到system32下,可能是数据库连接的问题吧。所有我就把php安装目录下的libmysql.dll复制到system32下,再次运行,通过!这个问题困扰了我几个小时,希望以此为鉴。大家要注意版本匹配。

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

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.

Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.

Gate.io is a popular cryptocurrency exchange that users can use by downloading its installation package and installing it on their devices. The steps to obtain the installation package are as follows: Visit the official website of Gate.io, click "Download", select the corresponding operating system (Windows, Mac or Linux), and download the installation package to your computer. It is recommended to temporarily disable antivirus software or firewall during installation to ensure smooth installation. After completion, the user needs to create a Gate.io account to start using it.
