IIS6部署PHP

Jun 23, 2016 pm 02:34 PM

在IIS6上安装PHP5(以PHP5.2.0为例)
1、首先在php.net上下载windows用的zip包。然后解压,如解压在“C:\php5”

2、把根目录下的php5ts.dll复制到系统windows目录下;把php.ini-dist文件改名为php.ini后复制到系统windows目录下。

3、用文本编辑器打开php.ini文件,查找“register_globals”,把后面的Off改为On。该项设置是关于自定义全局变量。

4、查找“extension_dir”,把后面的值改为php解压文件夹的ext子目录下,如“C:\php5\ext”

5、查找“extension”,把需要用到的扩展模块前的;号去掉。如需要用mysql的就是php_mysql.dll,如需要用mysqli的话,就需要自己加一句extension=php_mysqli.dll。有些扩展库可能需要额外的 DLL 才能工作,具体请查看这里,如果列表里的注解中有说明,则需要在解压根目录或者ext子目录找到该文件,然后复制到系统windows目录中。
如php_mysql.dll和php_mysqli.dll就需要把根目录下的libmysql.dll复制到系统windows目录中

6、打开IIS,找到需要使用php的站点,点右键-属性,找到“主目录”选项卡,点击“配置”按钮,在“映射”选项卡中,点“添加”按钮,通过“浏览”,找到php解压目录下的php5isapi.dll文件,确定,“扩展名”填“.php”,其他选项默认即可。

7、找到IIS的web服务扩展,点击“添加一个新的web服务扩展”,扩展名可以为“php”,添加文件同样为php5isapi.dll,并把“设置扩展状态为允许”勾选。

8、在开始-运行里输入iisreset,确定,重启IIS。至此,在IIS6上安装PHP5已经完成。

常见问题:
1、如出现一些“failed to open stream”等提示,一般是因为权限问题,我的解决方法是给everyone对php的解压目录的读取和运行权限,给iis两个用户对网站的web目录读取和运行权限。相关参考文章:[小勤]WIN主机配置PHP的若干问题解决方案总结

PS:关于php.ini里的选项设置,可以查看这里。

在Windows上安装MySQL5(以5.0.24a为例)
在mysql.com上下载windows的安装文件,然后运行,根据提示一步步next,基本上不需要做任何调整。安装完成后会自动打开配置程序,根据需要做一些调整。至最后一步,配置程序可能会提示无法连接数据服务器,这时候,需要点击重试按钮,否则可能会发生程序无法连接服务器的情况。

如果出现如上所述情况,需通过mysql自身的卸载程序卸载mysql,并把安装目录和数据目录清空,重启,然后再安装。否则将会重复之前的问题。我第一次就是在这里卡了好久一段时间。

在IIS6上安装Perl5(以5.8.8.819为例)
1、在ActiveState上下载ActivePerl,运行,根据提示完成安装。

2、打开IIS,找到需要使用perl的站点,点右键-属性,找到“主目录”选项卡,点击“配置”按钮,在“映射”选项卡中,点“添加”按钮,通过“浏览”,找到perl安装目录的bin子目录,把查找文件类型设为CGI(*.exe文件),选择perl.exe文件,确定,“扩展名”填“.pl”,其他选项默认即可。

3、找到IIS的web服务扩展,把“Perl CGI Extension”设为允许状态。

4、对perl的安装目录,给予iis的两个帐户以读取和运行、修改、写入的权限。


在IIS6上安装DevMS的IIS-Tools(以1.1.0.0为例)
1、在DevMS.Com上下载压缩包,解压。

2、打开IIS,找到需要使用IIS-Tools的站点,点右键-属性,找到“ISAPI筛选器”选项卡,点击“添加”按钮,筛选器名称可以为“devms”,浏览文件,找到解压包里的Devms.Com.IISTools.dll文件。确定添加。

3、找到IIS的web服务扩展,点击“添加一个新的web服务扩展”,扩展名可以为“devms”,添加文件同样为Devms.Com.IISTools.dll,并把“设置扩展状态为允许”勾选。

4、对网站的web目录,给予SERVICE帐户的完全权限。

5、重启IIS即可。

PTW:
DevMs的IIS-Tools特性:
1、URL重定向(URL ReWrite)
完全支持各类型的URL重定向.如常见的无后缀名等
通过正则表达式设定重定向匹配项目.最多可达255个项目
支持对文件的访问请求有条件进行监控,如cookie、引用来源等

2、防盗链
实现了文件非法访问监控(防止盗链).允许使用引用来源和COOKIE验证两种方法

Statement of this Website
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

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

How does PHP type hinting work, including scalar types, return types, union types, and nullable types? How does PHP type hinting work, including scalar types, return types, union types, and nullable types? Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

How do you prevent SQL Injection in PHP? (Prepared statements, PDO) How do you prevent SQL Injection in PHP? (Prepared statements, PDO) Apr 15, 2025 am 12:15 AM

Using preprocessing statements and PDO in PHP can effectively prevent SQL injection attacks. 1) Use PDO to connect to the database and set the error mode. 2) Create preprocessing statements through the prepare method and pass data using placeholders and execute methods. 3) Process query results and ensure the security and performance of the code.

See all articles