- 时间:2020-05-09 08:39 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:WIN2003系统IIS下PHP5+MySQL5+ZendOptimizer配置图解教程第1/3页
一.下载好php5、mysql5及ZendOptimizer和phpmyadmin的安装程序
PHP下载地址[url=http://www.php.net/downloads.php]http://www.php.net/downloads.php[/url]
MySQL 4下载地址[url=http://dev.mysql.com/downloads/mysql/4.1.html]http://dev.mysql.com/downloads/mysql/4.1.html[/url]
MySQL 5下载地址[url=http://dev.mysql.com/downloads/mysql/5.0.html]http://dev.mysql.com/downloads/mysql/5.0.html[/url]
ZendOptimizer下载地址(需注册)[url=http://www.zend.com/store/free_download.php?pid=13]http://www.zend.com/store/free_download.php?pid=13[/url]
Phpmyadmin下载地址[url=http://www.phpmyadmin.net/home_page/downloads.php]http://www.phpmyadmin.net/home_page/downloads.php[/url]
本例中使用的是
php-5.1.2-Win32.zip,mysql-5.0.19-win32.zip,ZendOptimizer-2.6.2-Windows-i386.exe,phpMyAdmin-2.8.0.2.rar
二.配置iis下的php环境
首先解压php-5.1.2-Win32.zip到C:\php目录
[img]http://files.jb51.net/upload/200731117615893.jpg[/img]
复制C:\php目录及C:\php\ext目录下所有的dll文件到系统的system32目录,在win2003和winxp下是C:\windows\system32目录,win2000则是 C:\winnt\system32
[img]http://files.jb51.net/upload/200731117620422.jpg[/img]
[img]http://files.jb51.net/upload/200731117621686.jpg[/img]
[img]http://files.jb51.net/upload/200731117621705.jpg[/img]
将系统目录(在win2003和winxp下是C:\windows目录,win2000则是 C:\winnt)中的php.ini-dist改名为php.ini
[img]http://files.jb51.net/upload/200731117621933.jpg[/img]
[img]http://files.jb51.net/upload/200731117621605.jpg[/img]
[img]http://files.jb51.net/upload/200731117621218.jpg[/img]
用文本编辑软件打开php.ini
找到
[img]http://files.jb51.net/upload/200731117621229.jpg[/img]
将register_globals = Off改为register_globals = On
这个是打开php访问表单数据的简短风格写法支持,在PHP4.2.0版本以后这个选项默认是off的
[img]http://files.jb51.net/upload/200731117621494.jpg[/img]
找到
[img]http://files.jb51.net/upload/200731117621828.jpg[/img]
将extension_dir = "./"改为extension_dir = "C:\php\ext"
[img]http://files.jb51.net/upload/200731117621438.jpg[/img]
找到
[img]http://files.jb51.net/upload/200731117621821.jpg[/img]
去掉以下句子前面的分号
extension=php_mbstring.dll
extension=php_dbase.dll
extension=php_gd2.dll
extension=php_ldap.dll
extension=php_mssql.dll
extension=php_mysql.dll
找到date.timezone
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Hong_Kong
然后保存修改后的php.ini
接下来配置IIS的php支持
首先需要你的服务器安装了IIS
然后打开IIS管理器
右键 “默认网站” 选择 “属性”
选择 “ISAPI 筛选器” 标签
点击 “添加”
筛选器名称 填写 php
浏览 选择C:\php\php5isapi.dll
点击 确定
点击 应用
[img]http://files.jb51.net/upload/200731117622910.jpg[/img]
选择 “主目录” 标签
点击 “配置”
点击 “添加”
[img]http://files.jb51.net/upload/200731117622792.jpg[/img]
点击 “浏览” 选择C:\php\php5isapi.dll
在扩展名内填写 .php
点击确定
[img]http://files.jb51.net/upload/200731117622785.jpg[/img]
点击“选项“标签
勾选 “启用父路径”
[img]http://files.jb51.net/upload/200731117622584.jpg[/img]
在 “默认网站”的“属性”页面中选择“文档”标签
点击“添加”
输入index.php后确定
[img]http://files.jb51.net/upload/200731117622151.jpg[/img]
然后点击“上移”将index.php提高到最前,如果你所要挂的网站默认首页不是index.php,你也可以另外添加并提升到最高。
注意:请确定Web目录的应用程序设置和执行许可中选择为纯脚本
[img]http://files.jb51.net/upload/200731117622838.jpg[/img]
关闭 Internet 信息服务管理器
接下来打开iis对php的支持
点击“Internet 服务管理器”左边的“WEB服务扩展”
[img]http://files.jb51.net/upload/200731117622484.jpg[/img]
选中Active Server Pages 并点击中间的允许,打开asp的支持(虽然对php来说这个打开不打开无所谓,但是asp的使用比较广泛,如果没有打开,还是建议打开)
在右边web服务扩展处,右键,选择“添加一个新的web 服务扩展”
[img]http://files.jb51.net/upload/200731117622723.jpg[/img]
在扩展名内填写php
然后点击添加,浏览点选C:\php\php5isapi.dll
勾上下面的“设置扩展状态为允许”
[img]http://files.jb51.net/upload/200731117622947.jpg[/img]
确定后点击,开始—运行
输入cmd后确定
依次输入
net stop iisadmin /y
net start w3svc
[img]http://files.jb51.net/upload/200731117622461.jpg[/img]
在默认网站的目录中新建一个test.php
输入如下信息
<?php
phpinfo();
?>
后保存
在浏览器中执行
[url=http://localhost/test.php]http://localhost/test.php[/url]
[img]http://files.jb51.net/upload/200731117623259.jpg[/img]
如果前面的配置一切正确,这时候会显示本机的php各相关信息
三.接下来我们开始安装MySQL
当前1/3页 [b]1[/b][url=http://www.1sucai.cn/article/8211_2.htm]2[/url][url=http://www.1sucai.cn/article/8211_3.htm]3[/url][url=http://www.1sucai.cn/article/8211_2.htm]下一页[/url][url=http://www.1sucai.cn/article/8211_all.htm]阅读全文[/url]