而FastCGI执行方式是以单一线程来执行操作,所以不需要进行线程的安全检查,除去线程安全检查的防护反而可以提高效率,所以,如果是以FastCGI来执行PHP,建议选择Non Thread Safe版本;
将php解压缩,我这里将解压缩后的文件放在了D盘下,如图
将php文件中php.ini-production
文件重命名为php.ini,并修改php.ini文件
extension_dir = “
你的PHP安装程序安装路径ext文件夹”
设置时区
查找date.timezone =
改成date.timezone = Asia/Shanghai
设置.dll文件,将前面的";"取消,这个;符号起到注释作用,如下 (建议手动将;去掉,直接复制我下面的可能会有问题) 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 ; The MIBS data available in the PHP distribution must be installed. ; See http://www.php.net/manual/en/snmp.installation.php extension=php_snmp.dll extension=php_soap.dll extension=php_sockets.dll extension=php_sqlite3.dll extension=php_sybase_ct.dll extension=php_tidy.dll extension=php_xmlrpc.dll extension=php_xsl.dll 查找设置以下内容,值等于1 fastcgi.impersonate = 1 Cgi.rfc2616_headers = 1 查找设置以下内容,值等于0 cgi.force_redirect = 0 查找设置以下内容,默认Off,改成On short_open_tag = On
到此为止整个php.ini文件就配置好了,保存退出即可
接下来配置IIS的“处理程序映射”,配置方法以及内容见下图
接下来添加默认主页,点击默认文档添加index.php