Installing PHP5.2 and php5.4 configuration methods in IIS

Source: Internet
Author: User
Tags apm php script time interval win32 zip zend

Install PHP5.2 configuration in IIS

First download the PHP installation file.
Download Address: http://windows.php.net/download/

We download the PHP 5.2 (5.2.14) version, because the PHP 5.3 (5.3.3) does not support ISAPI and requires additional fastcgi installation.

Here we take ISAPI as an example, so download the PHP 5.2 (5.2.14) version.

The download is also divided into VC6 x86 Non thread safe and VC6 x86 thread safe, one that is not thread protected and one that is thread protected. Since we use the IIS ISAPI and are multi-threaded, we recommend using VC6 x86 Thread Safe.

In the download version, there are three, hehe, some people see here are dizzy, how so much ah. I don't know which one to choose. Zip is a compressed file, decompression, the installation of their own manually, installer is MSI file, double-click the installation, this is not much to say this. Let's talk about manual installation.

Here's the whole process.

1. Download the zip uncompressed D-disk directly under PHP.

2. Locate the Php.ini-dist file, copy it to c:windows, and rename it php.ini, and copy Php5ts.dll and Libmysql.dll to C:windowssystem32.

3. Use Notepad to open just renamed php.ini file, find Extension_dir = "./", change to Extension_dir = "D:phpext".

4. Look up "Extension=php_mysql.dll" and "Extension=php_gd2.dll" in Notepad, then put the front ";" To remove or Extension=php_mysql.dll to Extension=php_mysql.dll.
Put the following in front of;
; Extension=php_mbstring.dll
; Extension=php_gd2.dll
; Extension=php_dbase.dll
; Extension=php_ldap.dll

5. Find; Session.save_path = "/tmp" will be '; ' get rid of it. Set the directory where you saved the session.
such as: Session.save_path = "C:windowstemp";

6. Locate register_globals and change off to On

7. Locate Allow_url_include and change off to On

8. Save PHP.ini

Here is the design in IIS.

1. Add the PHP extension first, as shown in the "Web service Extension" in IIS, the blank right side of the right click First to add, the extension is PHP, the requested file selection D:phpphp5isapi.dll, the following has a "set extended state to allow" also selected. Point determination

2. Then create a new Web site in IIS, add it in the ISAPI filter, fill in PHP with the filter name, select D:phpphp5isapi.dll for the executable file, and then determine

3. Finally, under the home directory. Point configuration, and then insert. Executable file selection d:phpphp5isapi.dll, extension write. php, other invariant, OK.

4. The configuration is good.

Install PHP5.4 configuration in IIS

Download FastCGI 1.5 for IIS x86/x64, add FastCGI mappings Http://www.iis.net/download/FastCGI


Edit C:windowssystem32inetsrvfcgiext.ini content as follows

Copy Code code as follows:

[Types]
php=php

[PHP]
Exepath=d:phpphp-cgi.exe
instancemaxrequests=10000
environmentvars=php_fcgi_max_requests:10000


D:phpphp.ini main modification points are as follows


Output_buffering = On
Disable_functions = System,passthru,shell_exec,exec,popen,proc_open
ENABLE_DL = Off

Upload_tmp_dir = "d:/tmp/uploadtemp/"
Session.save_path = "d:/tmp/sessiondata/"
Date.timezone = "etc/gmt-8"; it means gmt+8.
Mbstring.language = Neutral; Set default language to Neutral (UTF-8) (default)
mbstring.internal_encoding = UTF-8; Set internal encoding to UTF-8


Cgi.force_redirect = 0
Cgi.fix_pathinfo = 1
Fastcgi.impersonate = 1


OP Accelerator, Zend Optimizer reference configuration, do not open xdebug when formally used. Note that the path is modified to the correct.


[Eaccelerator]
; zend_extension= "/apm/ext/eaccelerator_v0_9_6_for_v5_2_13-vc6/eaccelerator.dll"
; zend_extension= "/apm/ext/eaccelerator_v1_0_svn412_for_v5_2_13-vc6/eaccelerator.dll"
Eaccelerator.shm_size= "16"
Eaccelerator.cache_dir= "/tmp/eaccelerator"
eaccelerator.enable= "1"
Eaccelerator.optimizer= "1"
Eaccelerator.check_mtime= "1"
eaccelerator.debug= "0"
; eaccelerator.log_file= "/var/log/httpd/eaccelerator_log"
Eaccelerator.filter= ""
eaccelerator.shm_max= "0"
Eaccelerator.shm_ttl= "300"
eaccelerator.shm_prune_period= "0"
eaccelerator.shm_only= "0"
eaccelerator.compress= "1"
Eaccelerator.compress_level= "9"

[Zend]
Zend_optimizer.optimization_level=15
Zend_optimizer.encoder_loader=0
; zend_extension_ts= "/apm/ext/zendoptimizer-3.3.0/lib/optimizer-3.3.0/php-5.2.x/zendoptimizer.dll"
; zend_extension= "/apm/ext/zendoptimizer_nts.dll"
; zend_extension= "/apm/ext/zendoptimizerplus.dll"

; The following is a reference configuration using ZendExtensionManager.dll
; zend_extension_manager.optimizer_ts= "/apm/zend/zendoptimizer-3.3.0/lib/optimizer-3.3.0"
; zend_extension_ts= "/apm/zend/zendoptimizer-3.3.0/lib/zendextensionmanager.dll"
; zend_extension_manager.debug_server_ts= "/apm/zend/zendoptimizer-3.3.0/lib/zenddebugger-5.2.13-cygwin_nt-i386"
; zend_debugger.expose_remotely=always
; zend_debugger.allow_hosts=127.0.0.1/32
; zend_debugger.allow_tunnel=127.0.0.1/32
[Zenddebugger]
; You can load it with Zend_optimizer at the back.
; zend_extension_ts= "/apm/ext/zenddebugger-5.2.15rc1-cygwin_nt-i386/php-5.2.x/zenddebugger.dll"

[Xcache-common]
; zend_extension= "D:/apm/ext/xcache-1.3.0-php-5.2.10-nts-win32-vc6-x86/php_xcache.dll"
; Extension = Php_xcache.dll

[Xcache.admin]
Xcache.admin.enable_auth = Off
Xcache.admin.user = "MOo"
; Xcache.admin.pass = MD5 ($ your password)
Xcache.admin.pass = ""

[XCache]
; Most of the options here can only be modified in INI, and here are the default values, unless otherwise stated
; Select Low Level shm/allocator scheme implemenation
Xcache.shm_scheme = "Mmap"
; Disabling: xcache.size=0
; Enable: xcache.size=64m (any >0 value) Please also note that your system mmap upper limit
Xcache.size = 0
; Recommended set to CPU number (Cat/proc/cpuinfo |GREP-C processor)
Xcache.count = 1
; is only a reference value, you can safely store more than this number of items (PHP script/variable)
Xcache.slots = 8K
; The TTL for the cached item, 0 = Permanent
Xcache.ttl = 0
; Time interval for scanning expired items, 0 = Not scanned, other values in seconds
Xcache.gc_interval = 60

; Ditto, just for variable caching settings
Xcache.var_size = 1M
Xcache.var_count = 1
Xcache.var_slots = 8K
; Default, allow Ini_set ()
Xcache.var_ttl = 0
; Maximum TTL value
Xcache.var_maxttl = 0
Xcache.var_gc_interval = 300

; Test only with
Xcache.test = Off
; Invalid when/dev/zero
Xcache.readonly_protection = Off
; For *nix systems, the Xcache.mmap_path is a file path rather than a directory (it can not exist but must be created).
; If you expect to enable readonlyprotection, you can use a similar "/tmp/xcache"
; 2 php groups do not share the same/tmp/xcache
; For the WIN32 system, the xcache.mmap_path= anonymous map name, not the file path. Suggest using XCache Word to avoid conflict with other software
Xcache.mmap_path = "XCache"


; For *nix Systems only
; Set to null (disabled) or similar to "/tmp/phpcore/"
; Note that the directory should be able to write files to PHP (unrelated to Open_basedir)
Xcache.coredump_directory = ""

Xcache.cacher = On
Xcache.stat = On
Xcache.optimizer = Off

[Xcache.coverager]

; This setting is automatically off if xcache.coveragedump_directory is set to null
Xcache.coverager = Off

; Please make sure this catalog is readable by the Coverage Viewer script (note open_basedir)
; Depend on the Xcache.coverager=on
Xcache.coveragedump_directory = ""

[Xdebug]
Xdebug.var_display_max_depth = 10
; Xdebug.remote_autostart = 1
; xdebug.remote_enable=1
; XDEBUG.REMOTE_HANDLER=DBGP
; xdebug.remote_host=127.0.0.1
; xdebug.remote_mode=req
; Xdebug.idekey=default
; xdebug.remote_log= "/xdebug.log"
; xdebug.remote_port=9000
Xdebug.auto_trace=off
; xdebug.collect_params=on
; xdebug.collect_return=on
Xdebug.trace_output_dir= "/tmp/xdebug"
Xdebug.profiler_enable=off
Xdebug.profiler_output_dir= "/tmp/xdebug"
; zend_extension_ts= "/apm/ext/xdebug/php_xdebug-2.0.5-5.2.dll"
; zend_extension= "/apm/ext/xdebug/php_xdebug-2.0.5-5.2-nts.dll"
zend_extension= "/apm/ext/xdebug/php_xdebug-2.1.0beta3-5.2-vc6-nts.dll"


Here is the fallback scenario, configuring the PHP environment

Copy Code code as follows:

ISAPI mode
Download PHP extract to d:php set permissions Administrators and system complete, every read run.
Add environment variable phprc=d:php set load php.ini file path

Path join d:php use related dynamic link library

Add an extension and set it to allow.

Add PHP Mappings

Edit the php.ini file to restart IIS. Finish

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.