Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure PHP for IIS10

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to configure PHP in IIS10". The editor shows you the operation process through an actual case. The method of operation is simple, fast and practical. I hope this article "how to configure PHP in IIS10" can help you solve the problem.

When you first install IIS, find the World wide Web service, the application development function, and check the following three items: CGI ISAPI extension IASPI filter

1. Install php first

Http://windows.php.net/download/

I installed the phpstudy integrated environment and used the php5.2 inside.

two。 Configure php.ini copy php.ini-development, rename it to php.ini, and modify it as follows

2.1 path to the extension

; Directory in which the loadable extensions (modules) reside.extension_dir = "D:\ phpStudy\ php52\ ext"

Fill in your real PHP interpreter address, followed by the ext folder, which contains plug-ins

2.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.dllextension=php_curl.dll;extension=php_dba.dll;extension=php_dbase.dll;extension=php_fdf.dllextension=php_gd2.dll;extension=php_gettext.dll;extension=php_gmp.dll;extension=php_ifx.dll;extension=php_imap.dll Extension=php_interbase.dll;extension=php_ldap.dllextension=php_mbstring.dll;extension=php_exif.dllextension=php_mcrypt.dll;extension=php_mhash.dll;extension=php_mime_magic.dll;extension=php_ming.dll;extension=php_msql.dll;extension=php_mssql.dllextension=php_mysql.dllextension=php_mysqli.dll;extension=php_oci8.dll;extension=php_openssl.dllextension=php_pdo.dll;extension=php_pdo_firebird.dll;extension=php_pdo_mssql.dllextension=php_pdo_mysql.dll;extension=php_pdo_oci.dll;extension=php_pdo_oci8.dllextension=php_pdo_odbc.dll Extension=php_pdo_pgsql.dllextension=php_pdo_sqlite.dll;extension=php_pgsql.dll;extension=php_pspell.dll;extension=php_shmop.dll;extension=php_snmp.dll;extension=php_soap.dll;extension=php_sockets.dllextension=php_sqlite.dll;extension=php_sybase_ct.dll;extension=php_tidy.dll;extension=php_xmlrpc.dll;extension=php_xsl.dllextension=php_zip.dll;extension=php_mongo.dl;extension=php_sqlsrv.dll;extension=php_pdo_sqlsrv.dll;extension=php_ibm_db2.dll;extension=memcache.dll

2.3 set time zone

[Date]; Defines the default timezone used by the date functionsdate.timezone = PRC

Change to

Date.timezone = Asia/Shanghai

2.4 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 (03amp 17amp 2002), Set to 1 if running under IIS. Default is zero. Fastcgi.impersonate = 1

2.5 cgi related Settings pathinfo

; cgi.fix_pathinfo provides * real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP'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 it's 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. Cgi.fix_pathinfo=0

2.6 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.** cgi.force_redirect = 0

IIS official website https://www.iis.net also said to open the error log, I did not open it.

Set error_log= "C:php_errors.log" This can help with troubleshooting.

This is the configuration php description of the official website.

Https://www.iis.net/learn/app...

Chinese related documents of Microsoft's official technical resource library

Https://technet.microsoft.com...

3. When configuring IIS, when installing IIS, check the following three items: CGI ISAPI extended IASPI filter

3.1 find handler mapping and add module mapping

After clicking OK, a warning dialog box will pop up and click "Yes". Since it has been added, you can find the cut image of the added module here.

Find the ISPAI and CGI restrictions and click the add to the right. The screenshot here is added.

Find the ISPAI filter and click add on the right. Here is also the screenshot that has been added.

3.4 add default document

After that, create a new site for testing, create a new index.php under the root directory of the added site, enter and save, then browse the website, and you will see the phpinfo information.

This is the end of the introduction to "how IIS10 configures PHP". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report