亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

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//這里應(yīng)該是填一個(gè)值,比如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進(jìn)程意外退出500錯誤”。默認(rèn)已經(jīng)有一個(gè)網(wǎng)站占用了所有端口,現(xiàn)在我們又添加一個(gè)網(wǎng)站可能導(dǎo)致沖突,把默認(rèn)那個(gè)網(wǎng)站停止就可以了。

6、集成CodeIgniter框架

<1>下載CodeIgniter

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

<2>整合CodeIgniter

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

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

<3>添加favicon圖標(biāo)

每個(gè)page都會自動去加載favicon圖標(biāo),因此應(yīng)該在index.php目錄下放置favicon.ico文件,不然都會報(bào)錯,顯示找不到圖標(biāo)。

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

<1>丟失 MSVCR110.dll

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

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

-點(diǎn)擊下載

-選擇相應(yīng)的版本,64就選64,32就選32

-點(diǎn)擊下載

-安裝

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

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

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

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

<3>服務(wù)器部署中常見問題

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

注意,因?yàn)榘裺ystem和application文件夾移到web目錄以外,但是程序在訪問的時(shí)候仍然會訪問到這兩個(gè)文件夾,因此也要把這兩個(gè)文件夾添加everyone。

<4>升級php7遇到的問題

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

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

開始運(yùn)行,cgi異常。直接打開cgi發(fā)現(xiàn)報(bào)錯:丟失VCRUNTIME140.dll。這個(gè)錯誤是因?yàn)樽钚掳娴膒hp7(php7.1)需要安裝Visual C++Redistributable 2015。

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

<5>最便捷的解決方案

今天調(diào)試剛買的服務(wù)器,發(fā)現(xiàn)無論怎么弄都會報(bào)FastCgi錯誤,錯誤代碼是***0005,即5號代碼的錯誤。怎么弄都不行,一度懷疑此云服務(wù)器的FastCgiModule被閹割了,不能正常運(yùn)行。

直到找到了這樣一個(gè)解決方案,https://php.iis.net,可以在線安裝。踏破鐵鞋無覓處,得來全不費(fèi)功夫。

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)

Hot Topics

PHP Tutorial
1488
72
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 set up iis application pool How to set up iis application pool Apr 09, 2024 pm 07:51 PM

The IIS Application Pool Setup Guide provides detailed instructions for configuring application pools directly in IIS Manager: application name, mode, launch type managed mode, authentication, loading user profile 32-bit application enablement, recycling frequency and reason Application path, hosting mode, initial memory allocation virtual directory, initialization module, fault isolation mode

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.

AI helps brain-computer interface research, New York University's breakthrough neural speech decoding technology, published in Nature sub-journal AI helps brain-computer interface research, New York University's breakthrough neural speech decoding technology, published in Nature sub-journal Apr 17, 2024 am 08:40 AM

Author | Editor Chen Xupeng | ScienceAI Aphasia due to defects in the nervous system can lead to serious life disabilities, and it may limit people's professional and social lives. In recent years, the rapid development of deep learning and brain-computer interface (BCI) technology has provided the feasibility of developing neurospeech prostheses that can help aphasic people communicate. However, speech decoding of neural signals faces challenges. Recently, researchers from VideoLab and FlinkerLab at the University of Jordan have developed a new type of differentiable speech synthesizer that can use a lightweight convolutional neural network to encode speech into a series of interpretable speech parameters (such as pitch, loudness, formant frequency, etc.), and synthesize these parameters into speech through a differentiable neural network. this synthesizer

where is the iis log where is the iis log Apr 09, 2024 pm 07:57 PM

IIS logs are typically stored in the following locations: Windows Server 2008 and above: %SystemDrive%\inetpub\logs\LogFilesWindows Server 2003: %SystemDrive%\Documents and Settings\All Users\Application Data\Microsoft\IIS\LogFiles

How to open xml format How to open xml format Apr 02, 2025 pm 09:00 PM

Use most text editors to open XML files; if you need a more intuitive tree display, you can use an XML editor, such as Oxygen XML Editor or XMLSpy; if you process XML data in a program, you need to use a programming language (such as Python) and XML libraries (such as xml.etree.ElementTree) to parse.

See all articles