国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Topics IIS Introduction to configuring php server on IIS

Introduction to configuring php server on IIS

Feb 20, 2021 am 09:34 AM
iis Configure php

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

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
 extension_dir = "c:\PHP\ext"

Modify the last line and fill in your real PHP interpreter address, followed by the ext folder, which contains all plug-ins

<2> ;Set which plug-ins to introduce

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

For the plug-ins to be introduced, just remove the semicolon in front of it. I only introduced mysql, mysqli, and mbstring here.

<3>Set time zone

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Shanghai

<4>Support short tags

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = On

<5>Enable fastcgi

; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
; security tokens of the calling client.  This allows IIS to define the
; security context that the request runs under.  mod_fastcgi under Apache
; does not currently support this feature (03/17/2002)
; Set to 1 if running under IIS.  Default is zero.
; http://php.net/fastcgi.impersonate
fastcgi.impersonate = 1

<6> cgi related settings pathinfo

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP&#39;s
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting
; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo
cgi.fix_pathinfo=1

<7>cgi related settings redirect

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; http://php.net/cgi.force-redirect
cgi.force_redirect = 0

<8>session storage path

; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process&#39;s umask.
; http://php.net/session.save-path
session.save_path = "d:\server\web\session"

<9>database

mysql.default_port = 3306

mysql.default_host = localhost

mysql.default_user = root

<10>Output cache

; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
output_buffering = On//這里應該是填一個值,比如4096

<11>Limit the maximum upload file size Value
upload_max_filesize = 100M

<12>Hide php version

Change On to Off, the php version will not be displayed in the header

expose_php = Off

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 to

do this.

5. Configure IIS (IIS has been installed by default, and I will not introduce how to install IIS here) <1>HandlerMappings )

After clicking OK, a pop-up will appear A warning dialog box, just click "Yes".

Note: The FastCgiModule module may not be available at the beginning. To turn on or off windows features - web server IIS - add role service - check CGI to install.

<2>ISAPI and CGI restrictions

# <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

<?php phpinfo(); ?>

<6>Open the website

Configure hosts to point, point the website domain name just configured to 127.0.0.1, like this:

127.0.0.1 yourdomain.com
Open yourdomain.com in the browser, you can see that the index.php file has been successfully parsed, and the display is php related information.

有可能出現(xiàn)的錯誤:訪問可能出現(xiàn)“FastCGI進程意外退出500錯誤”。默認已經(jīng)有一個網(wǎng)站占用了所有端口,現(xiàn)在我們又添加一個網(wǎng)站可能導致沖突,把默認那個網(wǎng)站停止就可以了。

6、集成CodeIgniter框架

<1>下載CodeIgniter

下載地址:http://codeigniter.org.cn/

<2>整合CodeIgniter

解壓之后,打開CodeIgniter文件夾,將里面的內(nèi)容復制粘貼到站點的根目錄,會提示是否替換掉原來的index.php文件,選擇"是",這樣框架就算整合完畢了

打開瀏覽器訪問主頁,看到的是CodeIgniter框架的提示信息!

<3>添加favicon圖標

每個page都會自動去加載favicon圖標,因此應該在index.php目錄下放置favicon.ico文件,不然都會報錯,顯示找不到圖標。

7、有可能出現(xiàn)的問題

<1>丟失 MSVCR110.dll

第一次訪問php網(wǎng)站可能會出現(xiàn)“無法啟動此程序,因為計算機中丟失 MSVCR110.dll”的錯誤,應該這樣解決:

-打開微軟下載頁面:http://www.microsoft.com/zh-CN/download/details.aspx?id=30679

-點擊下載

-選擇相應的版本,64就選64,32就選32

-點擊下載

-安裝

完成之后網(wǎng)站就可以正常訪問了。

<2>唯一密鑰屬性“value”設置…無法添加類型為add

在web.config-files節(jié)點改為:

            <files>
 <clear />
                 <add value="index.php" />
 <add value="index.html" />
             </files>

<3>服務器部署中常見問題

服務器碰見了一些問題 ,一個就是上面說的value屬性,value設置好之后就是cgi問題,沒有權限之類的,把php引擎的文件夾設置everyone之后,發(fā)現(xiàn)cgi意外退出,直接打開cgi,發(fā)現(xiàn)原來是丟失 MSVCR110.dll,把丟失 MSVCR110.dll裝上之后好了。

注意,因為把system和application文件夾移到web目錄以外,但是程序在訪問的時候仍然會訪問到這兩個文件夾,因此也要把這兩個文件夾添加everyone。

<4>升級php7遇到的問題

升級php7傳說中性能可以提升很多倍。php5竟然是10多年前的產(chǎn)物...

配置php.ini沒碰到什么問題,主要一個是mysql.dll的選項沒了,配置數(shù)據(jù)庫的port、username等都不是mysql而是mysqli,這些我就沒弄了,在CI里面會有配置,應該沒什么大問題。

開始運行,cgi異常。直接打開cgi發(fā)現(xiàn)報錯:丟失VCRUNTIME140.dll。這個錯誤是因為最新版的php7(php7.1)需要安裝Visual C++Redistributable 2015。

下載地址:https://www.microsoft.com/en-US/download/details.aspx?id=48145,下載安裝就好了。

<5>最便捷的解決方案

今天調(diào)試剛買的服務器,發(fā)現(xiàn)無論怎么弄都會報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!

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

Undress AI Tool

Undress AI Tool

Undress images for free

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.

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 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)

How to generate URL from html file How to generate URL from html file Apr 21, 2024 pm 12:57 PM

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.

How to open iis application pool How to open iis application pool Apr 09, 2024 pm 07:48 PM

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.

Can iis log files be deleted? How to delete them? Can iis log files be deleted? How to delete them? Apr 09, 2024 pm 07:45 PM

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.

How to solve iis cannot start How to solve iis cannot start Dec 06, 2023 pm 05:07 PM

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.

iis cannot start solution iis cannot start solution Oct 24, 2023 pm 03:04 PM

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.

What should I do if iis cannot start? What should I do if iis cannot start? Dec 06, 2023 pm 05:13 PM

Solutions to iis failure to start: 1. Check the integrity of the system files; 2. Check the port occupancy; 3. Start related services; 4. Reset the IIS configuration; 5. Reinstall IIS; 6. Check the event viewer log; 7 , Regular maintenance and updates; 8. Back up important data. Detailed introduction: 1. Check the integrity of the system files, run the system file checking tool, check the integrity of the system files, if you find problems with the system files, you can try to repair or replace the damaged files; 2. Check the port occupancy, in Windows Command prompt method.

How to open iis manager on computer How to open iis manager on computer Apr 09, 2024 pm 07:24 PM

IIS Manager can be opened through Control Panel, Command Prompt, or Run window. Once opened, it contains detailed information and configuration settings about the web server, organized into: Server, Site, Application Pool, Feature View, and Common Tasks.

How to set up iis protocol How to set up iis protocol Apr 09, 2024 pm 07:39 PM

To set up the IIS protocol, follow these steps: Open IIS Manager, select the website. In the Actions panel, click Bind. Add the protocol to use (HTTP or HTTPS), specify the IP address and port. For HTTPS, configure the SSL certificate, select the certificate type and certificate. Save the changes and test the binding.

See all articles