search

IIS mysql php学习_PHP

Jun 01, 2016 pm 12:29 PM
cmysqlstudyInstallpasswordConfiguration

IIS

再往上找到很多资料版本都非常老,新发现这个似乎不错!linews可能采用php!

下面有人说不成功,下面我以WIN2003系统为例,重新安装配置演示下,增加截图给大家,强烈希望斑竹加精!

如果你在安装过程遇到问题欢迎光临http://bbs.xqin.com提出,本人将尽量帮忙解决!

完整标题:

Windows 2000/XP/2003 下 IIS PHP MySQL Zend Optimizer GD库 phpMyAdmin安装配置

关键词:Windows IIS下配置支持PHP MYSQL

Apache下支持PHP的配置方法比较简单,这里就不写了

一、软件准备:

以下均为截止2005-4-20的最新正式版本

PHP(5.0.4):http://cn.php.net/get/php-5.0.4-Win32.zip/from/a/mirror

MySQL(4.1.11):http://www.skycn.com/soft/1262.html

http://dev.mysql.com/downloads/mysql/4.1.html

Zend Optimizer(2.5.7):http://www.zend.com/store/free_download.php?pid=13

phpMyAdmin(2.6.2):http://www.skycn.com/soft/10687.html

http://www.crsky.com/SoftView/SoftView_4190.html

假设 C:\ 为你现在所使用操作系统的系统盘,如果你目前操作系统不是安装在 C:\ ,请自行修改。

二、安装 PHP :

(1)、下载后得到 php-5.0.4-Win32.zip ,解压至C:\Inetpub\php(这个路径可以随意,不过下面要是用到这个路径,请相应修改);

(2)、再将C:\Inetpub\php目录下的所有dll文件(主要是C:\Inetpub\php下C:\Inetpub\php\ext下的DLL文件)拷到c:\Windows\system32下,覆盖已有的dll文件;

(3)、将C:\PHP目录下的php.exe、php-win.exe和php.ini-dist三个文件拷到C:\Windows ( Windows 2000 下为 C:\WINNT)下;将C:\Windows\php.ini-dist改名为php.ini,然后用记事本打开,利用记事本的查找功能搜索

CODE:

register_globals = Off

,将 Off 改成 On ;

再搜索

CODE:

extension_dir =

,并将其路径指到你的 PHP 目录下的 extensions 目录,比如:extension_dir = "C:\Inetpub\php\ext" ;

搜索找到

CODE:

;Windows Extensions

将下面列举的

CODE:

;extension=php_dbase.dll

可选

CODE:

;extension=php_gd2.dll

这个是用来支持GD库的,一般需要,必选

CODE:

;extension=php_ldap.dll

可选

CODE:

;extension=php_mbstring.dll

这不选一般用PHPMYADMIN会出红色提示,故必选

CODE:

;extension=php_mssql.dll

这个是用来支持MSSQL的,可选

CODE:

;extension=php_mysql.dll

这个是用来支持MYSQL的,要支持MYSQL必选

将这些前的";"去掉,其他的你需要的也可以去掉前面的;然后关闭保存该文件。

本人配置成功后的PHP.INI文件示例:

http://xqin.com/iis/php.ini

(4)、配置 IIS 使其支持 PHP :

首先必须确定系统中已经正确安装 IIS ,如果没有安装,需要先安装 IIS ,安装步骤如下:

打开浏览器,输入:http://localhost/,看到成功页面后进行下面的操作:

PHP 支持 CGI 和 ISAPI 两种安装模式,推荐使用 ISAPI 模式。这里只解介绍 ISAPI 模式安装方法:ISAPI 模式安装步骤:

在“控制面板”的“管理工具”中选择“Internet 服务管理器”,打开 IIS 后停止服务,然后在左侧“你需要支持PHP的Web站点”比如“默认Web站点”上单击右键选择“属性”,在打开的“ Web 站点属性”窗口的“ISAPI 筛选器”标签里找到并点击“添加”按钮,在弹出的“筛选器属性”窗口中的“筛选器名称”栏中输入:PHP ,再将可执行文件指向 php5isapi.dll 所在路径,如:C:\Inetpub\php\php5isapi.dll 。

打开“Web 站点属性”窗口的“主目录”标签,找到并点击“配置”按钮,在弹出的“应用程序配置”窗口中找到并点击“添加”按钮,在弹出的窗口中新增一个扩展名映射,扩展名为 .php ,单击“浏览”将可执行文件指向 php5isapi.dll 所在路径,如:C:\Inetpub\php\php5isapi.dll,然后一路确定即可。如果还想支持诸如 .php3 ,.phtml 等扩展名的 PHP 文件,可以重复“添加”步骤。

再打开“Web 站点属性”窗口的“文档”标签,找到并点击“添加”按钮,向默认的 Web 站点启动文档列表中添加 index.php 项。您可以将 index.php 升到最高优先级,这样,访问站点时就会首先自动寻找并打开 index.php 文档。

[img]http://xqin.com/iis/iis-8.gif/[img]

确定 Web 目录的应用程序设置和执行许可中选择为纯脚本,然后关闭 Internet 信息服务管理器,在命令提示符中执行如下命令:

net stop w3svc

net stop iisadmin

net start w3svc

然后在“Internet 服务管理器”左边的“WEB服务扩展”中设置ISAPI 扩展允许,Active Server Pages 允许

打开浏览器,输入:http://localhost/,看到成功页面后,在 IIS 根目录下新建一个 phpinfo.php ,内容如下:

CODE:

phpinfo();

?>

打开浏览器,输入:http://localhost/phpinfo.php,将显示当前服务器所支持 PHP 的全部信息,可以看到 Server API的模式为:ISAPI 。

三、安装 MySQL :

如果你下载的是 Windows Essentials (x86) ,将得到 mysql-4.1.11-essential-win.exe ,直接双击安装即可。这里本人安装到C:\Inetpub\MySQL,安装过程中会提示你是不是立即进行配置,选择否即可完成安装。安装完毕后,在“开始”菜单的“运行”中输入:C:\Inetpub\MySQL\bin\mysqld-nt -install ,运行成功之后再输入:net mysql start ,将会启动 MySQL 服务;如果你还想较详细的配置 MySQL ,就请进入 C:\Inetpub\MySQL\bin 目录,运行 MySQLInstanceConfig.exe ,按提示操作即可。

如果你下载的是 Windows (x86) ,解压后双击执行 Setup.exe 即可,步骤同上。

如果你下载的是 Without installer (unzip in C:\) ,直接解压到C:\Inetpub\MySQL,在“开始”菜单的“运行”中输入: C:\Inetpub\MySQL\bin\mysqld-nt.exe ,运行成功之后再输入:net mysql start ,即可启动 MySQL 服务。

为MYSQL设置密码,确保安全:

一般菜单里面有配置向导MySQL Server Instance Config Wizar,运行后按下面步骤配置设置ROOT密码即可

ROOT密码,建议社设置复杂点,确保服务器安全!

也可以在MySQL Command Line Client里面用命令配置:

首先在打开DOS窗口,然后进入目录 mysqlbin,再键入命令mysql -uroot -p,回车后提示你输密码,如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是:mysql>

修改密码。

格式:mysqladmin -u用户名 -p旧密码 password 新密码

例:给root加个密码xqin.com首先在DOS下进入目录mysqlbin,然后键入以下命令

mysqladmin -uroot -password xqin.com

注:因为开始时root没有密码,所以-p旧密码一项就可以省略了。

然后执行:

SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('xqin.com');

这里的命令是由于MySQL 4.1 及其后版本验证协议使用的密码哈希算法与老的客户端不兼容,在PHPMYADMIN里用正确密码登陆也会提示:

Client does not support authentication protocol requested

by server; consider upgrading MySQL client

所以是为后面正确使用PHPMYADMIN做准备

这样ROOT密码就设置为xqin.com了

四、安装 Zend Optimizer :

下载后得到 ZendOptimizer-2.5.7-Windows-i386.exe ,直接双击安装即可,安装过程要你选择 Web Server 时,选择 IIS ,然后提示你是否 Restart Web Server,选择是,完成安装之前提示是否备份 php.ini ,点确定后安装完成。需要注意的是:如果您的PHP是4.3以上版本,那么就不要用缺省安装,而应该用定制安装并选择 PHP的版本为PHP 4.3.X,方能正确安装,否则会说版本不支持。

我这里安装到C:\Inetpub\Zend

[img]http://xqin.com/iis/iis-15.gif[/img

Zend Optimizer 的安装向导会自动根据你的选择来修改 php.ini 帮助你启动这个引擎。下面简单介绍一下 Zend Optimizer 的配置选项。以下为本人安装完成后 php.ini 里的默认配置代码(分号后面的内容为注释):

zend_extension_ts="C:\Inetpub\Zend\lib\ZendExtensionManager.dll"

;Zend Optimizer 模块在硬盘上的安装路径。

zend_extension_manager.optimizer_ts="C:\Inetpub\Zend\lib\Optimizer-2.5.7"

;优化器所在目录,默认无须修改。

zend_optimizer.optimization_level=15

;优化程度,这里定义启动多少个优化过程,默认值是 15 ,表示同时开启 10 个优化过程中的 1-4 ,我们可以将这个值改为 1023 ,表示开启全部10个优化过程。

调用phpinfo()函数后显示:

Zend Engine v1.3.0, Copyright © 1998-2002 Zend Technologies with Zend Optimize

r v2.1.0, Copyright © 1998-2003, by Zend Technologies 则表示安装成功。

安装GD库

这一步在前面PHP.INI配置中实际上已经安装好了~

在php.ini里找到 "extension_dir",然后将路径指向extension,如下(假设你的php安装路

径为:C:\Inetpub\php、设置extension_dir = "C:\Inetpub\php、ext",完成这步后,在php.ini里找到"extension=php_gd2.dll"这一行,并且去掉前面的分号,gd库安装完成,用echophpinfo();测试是否成功!

五、安装 phpMyAdmin:

下载得到 phpMyAdmin-2.6.0.zip ,将其解压到 IIS 根目录,找到并打开 config.inc.php ,做以下修改:

搜索$cfg['PmaAbsoluteUri'],设置你的phpmyadmin的URL,如:$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/'; 注意这里假设phpmyadmin在默认站点的根目录下

搜索$cfg['blowfish_secret'],设定好root密码后这里也要填写比如ROOT密码xqin.com则设置为$cfg['blowfish_secret'] = 'xqin.com';

搜索$cfg['DefaultLang'] ,将其设置为 zh-gb2312 ;

搜索$cfg['DefaultCharset'] ,将其设置为 gb2312 ;

搜索$cfg['Servers'][$i]['auth_type'],默认为config,是不安全的,不推荐,推荐使用cookie,将其设置为$cfg['Servers'][$i]['auth_type'] = 'cookie';

注意这里如果设置为config请在下面设置用户名和密码!例如:

$cfg['Servers'][$i]['user'] = 'root'; // MySQL user-----MySQL连接用户

$cfg['Servers'][$i]['password'] = 'xqin.com';

本人的配置文件,仅供参考!

http://xqin.com/iis/config.inc.txt

打开浏览器,输入:http://localhost/phpMyAdmin/ ,若 IIS 和 MySQL 均已启动,输入用户ROOT密码xqin.com即可浏览数据库内容。

phpMyAdmin 的具体功能,请慢慢熟悉,这里不再赘述。

至此所有安装完毕

上面帖子文字限制

补充: Windows 2000/XP 下的 IIS 安装:

用 Administrator 帐号登陆系统,将 Windows 2000 安装光盘插入光盘驱动器,进入“控制面板”点击“添加/删除程序”,再点击左侧的“添加/删除 Windows 组件”,在弹出的窗口中选择“Internet 信息服务(IIS)”,点下面的“详细信息”按钮,选择组件,以下组件是必须的:“Internet 服务管理器”、“World Wide Web 服务器”和“公用文件”,确定安装。

安装完毕后,在“控制面板”的“管理工具”里打开“服务”,检查“IIS Admin Service”和“World Wide Web Publishing Service”两项服务,如果没有启动,将其启动即可。

Windows 2003 下的 IIS 安装:

由于 Windows 2003 的 IIS 6.0 集成在应用程序服务器中,因此安装应用程序服务器就会默认安装 IIS 6.0 ,在“开始”菜单中点击“配置您的服务器”,在打开的“配置您的服务器向导”里左侧选择“应用程序服务器(IIS,ASP.NET)”,单击“下一步”出现“应用程序服务器选项”,你可以选择和应用程序服务器一起安装的组件,默认全选即可,单击“下一步”,出现“选择总结界面”,提示了本次安装中的选项,配置程序将自动按照“选择总结”中的选项进行安装和配置。

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
How to calculate the total number of elements in a PHP multidimensional array?How to calculate the total number of elements in a PHP multidimensional array?May 15, 2025 pm 09:00 PM

Calculating the total number of elements in a PHP multidimensional array can be done using recursive or iterative methods. 1. The recursive method counts by traversing the array and recursively processing nested arrays. 2. The iterative method uses the stack to simulate recursion to avoid depth problems. 3. The array_walk_recursive function can also be implemented, but it requires manual counting.

What are the characteristics of do-while loops in PHP?What are the characteristics of do-while loops in PHP?May 15, 2025 pm 08:57 PM

In PHP, the characteristic of a do-while loop is to ensure that the loop body is executed at least once, and then decide whether to continue the loop based on the conditions. 1) It executes the loop body before conditional checking, suitable for scenarios where operations need to be performed at least once, such as user input verification and menu systems. 2) However, the syntax of the do-while loop can cause confusion among newbies and may add unnecessary performance overhead.

How to hash strings in PHP?How to hash strings in PHP?May 15, 2025 pm 08:54 PM

Efficient hashing strings in PHP can use the following methods: 1. Use the md5 function for fast hashing, but is not suitable for password storage. 2. Use the sha256 function to improve security. 3. Use the password_hash function to process passwords to provide the highest security and convenience.

How to implement array sliding window in PHP?How to implement array sliding window in PHP?May 15, 2025 pm 08:51 PM

Implementing an array sliding window in PHP can be done by functions slideWindow and slideWindowAverage. 1. Use the slideWindow function to split an array into a fixed-size subarray. 2. Use the slideWindowAverage function to calculate the average value in each window. 3. For real-time data streams, asynchronous processing and outlier detection can be used using ReactPHP.

How to use the __clone method in PHP?How to use the __clone method in PHP?May 15, 2025 pm 08:48 PM

The __clone method in PHP is used to perform custom operations when object cloning. When cloning an object using the clone keyword, if the object has a __clone method, the method will be automatically called, allowing customized processing during the cloning process, such as resetting the reference type attribute to ensure the independence of the cloned object.

How to use goto statements in PHP?How to use goto statements in PHP?May 15, 2025 pm 08:45 PM

In PHP, goto statements are used to unconditionally jump to specific tags in the program. 1) It can simplify the processing of complex nested loops or conditional statements, but 2) Using goto may make the code difficult to understand and maintain, and 3) It is recommended to give priority to the use of structured control statements. Overall, goto should be used with caution and best practices are followed to ensure the readability and maintainability of the code.

How to implement data statistics in PHP?How to implement data statistics in PHP?May 15, 2025 pm 08:42 PM

In PHP, data statistics can be achieved by using built-in functions, custom functions, and third-party libraries. 1) Use built-in functions such as array_sum() and count() to perform basic statistics. 2) Write custom functions to calculate complex statistics such as medians. 3) Use the PHP-ML library to perform advanced statistical analysis. Through these methods, data statistics can be performed efficiently.

How to use anonymous functions in PHP?How to use anonymous functions in PHP?May 15, 2025 pm 08:39 PM

Yes, anonymous functions in PHP refer to functions without names. They can be passed as parameters to other functions and as return values ​​of functions, making the code more flexible and efficient. When using anonymous functions, you need to pay attention to scope and performance issues.

See all articles

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

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment