Introduction to configuring php server on IIS
Recommended (free): IIS
1. Download php interpreter
The address is http://windows.php.net/download/
There are two versions, thread-safe and non-thread-safe. Thread-safe is for apache, and non-thread-safe. It is for iis. What we want to configure is iis, so download the non-thread-safe version. For x86 and x64, you can choose the corresponding version to download depending on the system of your machine.
2. Install the PHP interpreter In the system disk, then put the E:\PHP)
folder, even if the installation is completed.3. Configure php.ini
Copy php.ini-development, rename it to php.ini, and make the following modifications:< 1>The path of the extension plug-in
1 2 3 4 5 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
1 2 3 4 |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 |
|
1 2 3 4 |
|
mysql.default_host = localhost
mysql.default_user = root<10>Output cache1 2 3 4 5 6 |
|
<11>Limit the maximum upload file size Value
1 |
|
1 |
|
4. Change php .ini is placed in the system directory
After the configuration is completed, place a copy of php.ini under c:\windows. Note that if you are using iis7 with win7, you no longer need todo this.
5. Configure IIS (IIS has been installed by default, and I will not introduce how to install IIS here) <1>HandlerMappings )
# <3>Add a site
Create a folder under a certain path, add the site in IIS, and add this folder as a site
##Note that after adding a site, you need to add the everyone user to it and give it full permissions.
<4>Set the site default page
##<5>Add a default page
Create a file named index.php in the root directory of the website, enter
1 |
|
<6>Open the website
1 |
|

有可能出现的错误:访问可能出现“FastCGI进程意外退出500错误”。默认已经有一个网站占用了所有端口,现在我们又添加一个网站可能导致冲突,把默认那个网站停止就可以了。
6、集成CodeIgniter框架
<1>下载CodeIgniter
下载地址:http://codeigniter.org.cn/
<2>整合CodeIgniter
解压之后,打开CodeIgniter文件夹,将里面的内容复制粘贴到站点的根目录,会提示是否替换掉原来的index.php文件,选择"是",这样框架就算整合完毕了
打开浏览器访问主页,看到的是CodeIgniter框架的提示信息!
<3>添加favicon图标
每个page都会自动去加载favicon图标,因此应该在index.php目录下放置favicon.ico文件,不然都会报错,显示找不到图标。
7、有可能出现的问题
<1>丢失 MSVCR110.dll
第一次访问php网站可能会出现“无法启动此程序,因为计算机中丢失 MSVCR110.dll”的错误,应该这样解决:
-打开微软下载页面:http://www.microsoft.com/zh-CN/download/details.aspx?id=30679
-点击下载
-选择相应的版本,64就选64,32就选32
-点击下载
-安装
完成之后网站就可以正常访问了。
<2>唯一密钥属性“value”设置…无法添加类型为add
在web.config-files节点改为:
1 2 3 4 5 |
|
<3>服务器部署中常见问题
服务器碰见了一些问题 ,一个就是上面说的value属性,value设置好之后就是cgi问题,没有权限之类的,把php引擎的文件夹设置everyone之后,发现cgi意外退出,直接打开cgi,发现原来是丢失 MSVCR110.dll,把丢失 MSVCR110.dll装上之后好了。
注意,因为把system和application文件夹移到web目录以外,但是程序在访问的时候仍然会访问到这两个文件夹,因此也要把这两个文件夹添加everyone。
<4>升级php7遇到的问题
升级php7传说中性能可以提升很多倍。php5竟然是10多年前的产物...
配置php.ini没碰到什么问题,主要一个是mysql.dll的选项没了,配置数据库的port、username等都不是mysql而是mysqli,这些我就没弄了,在CI里面会有配置,应该没什么大问题。
开始运行,cgi异常。直接打开cgi发现报错:丢失VCRUNTIME140.dll。这个错误是因为最新版的php7(php7.1)需要安装Visual C++Redistributable 2015。
下载地址:https://www.microsoft.com/en-US/download/details.aspx?id=48145,下载安装就好了。
<5>最便捷的解决方案
今天调试刚买的服务器,发现无论怎么弄都会报FastCgi错误,错误代码是***0005,即5号代码的错误。怎么弄都不行,一度怀疑此云服务器的FastCgiModule被阉割了,不能正常运行。
直到找到了这样一个解决方案,https://php.iis.net,可以在线安装。踏破铁鞋无觅处,得来全不费功夫。
8、在本地配置https
本地测试为了可以跟线上一致,以https来测试,必须要配置ssl证书。
The above is the detailed content of Introduction to configuring php server on IIS. For more information, please follow other related articles on the PHP Chinese website!

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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











As we all know, when any file is in use, no other process can access/change it. In this case, when a process attempts to open a file, the operating system locks the file to prevent it from being modified by another process. “The process cannot access the file because it is in use by another process” is such an error message observed by many users on their Windows computers. This error is known to occur in different versions of WindowsOS and WindowsServer. Usually, this error message is observed during using Netsh command on the user’s Windows PC. Another situation where this error occurs is when trying to run the Internet Information Services (IIS) M

To open an application pool in IIS: 1. Open IIS Manager; 2. Navigate to the "Application Pools" node; 3. Right-click the target application pool and select "Manage"; 4. Click "Advanced Settings" Tab; 5. Application pool configuration can be viewed and modified here.

First, go to the official website to download the software package and unzip it. It is best not to have the path problem with the Chinese nginx configuration. Under Windows, the file path can be separated by "\", "\\", or "/". symbol. But "\" is the most likely to cause problems, so try to avoid using it. Do not add path, otherwise it will cause an error. The config file path cannot be found. For example, I decompressed the cmd command on the e drive to locate the folder where nginx.exe is located, cde:\worksoftware\nginx-1.10.1 and then execute it. First ensure the nginx.conf file There is no problem with the configuration. In fact, the most important and main job of nginx is the configuration file, and there is nothing else.

Converting an HTML file to a URL requires a web server, which involves the following steps: Obtain a web server. Set up a web server. Upload HTML file. Create a domain name. Route the request.

When using PHP for website development, you may encounter character encoding issues. Especially when using different web servers, you may find that IIS and Apache handle character encoding differently. When you use IIS, you may find that garbled characters appear when using UTF-8 encoding; but when using Apache, everything works fine without any problems. How should this situation be resolved?

Yes, it is possible to delete IIS log files. Removal methods include selecting the website or application pool through IIS Manager and deleting the log file in the Log Files tab. Use a command prompt to go to the log file storage directory (usually %SystemRoot%\System32\LogFiles\W3SVC1) and use the del command to delete the log file. Use third-party tools such as Log Parser to automatically delete log files.

Solutions to iis failure to start: 1. Check the integrity of the system files; 2. Check the port occupancy; 3. Start related services; 4. Reinstall IIS; 5. Reset the Windows system; 6. Check the metabase file; 7. Check file permissions; 8. Update the operating system and applications; 9. Avoid installing too many unnecessary software; 10. Back up important data regularly. Detailed introduction: 1. Check the integrity of system files, run system file checking tools, check the integrity of system files, etc.

Solution: 1. Check whether the IIS service has been installed; 2. Check dependent services; 3. Check port conflicts; 4. Check configuration files and permissions; 5. Re-register IIS related components; 6. Check log files.
