Windows 2003 under IIS configuration Mysql+php+isapi_rewrite+zend+xcache

Source: Internet
Author: User
Tags download zend file copy phpinfo cpu usage website ip zend ntfs permissions

Windows 2003 under IIS configuration Mysql+php+isapi_rewrite+zend+xcacheZend MySQL php iis Windows extension


I. Preparatory work

Windows 2003, buy it Yourself ...

To Install IIS 6.0:
After installing the system, in Control Panel, add or Remove Programs, add/Remove Windows components, double-click Application Server, and then select Internet Information Services (IIS), OK, install complete ...

Download php:Http://cn2.php.net/get/php-5.2.5-Win32.zip/from/this/mirror

download MySQL:Http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51a-win32.zip/from/pick#mirrors
According to your own speed, click on the following one of the countries http/ftp and other links to download ...

download Zend Optimizer:Http://www.zend.com/en/products/guard/downloads
Choose your own version of the download, I am under the 3.3.3 version ...

Download XCache:http://xcache.lighttpd.net/wiki/Release-1.2.2

Many people may not know what XCache is, here is a brief introduction:

XCache is a new PHP cache, after I test, under Windows, the effect is much stronger than similar software.

The actual test results are as follows (non-scientific method):

Average execution time of original page: 0.13 seconds
Average page execution time after acceleration: 0.03 seconds
Raw CPU Utilization: 15%-60%
Accelerated CPU Usage: 3%-30%

As can be seen from the above data, the use of this accelerator can greatly reduce CPU consumption (but it will cause more memory consumption.) and shorten the page execution time.

Because other similar software is not good enough for Windows, choosing XCache is the perfect choice for Windows hosts.

Already configured MySQL + PHP environment, want to see XCache configuration, please go to XCache under Win2003 and IIS6 the successful configuration method and troubleshooting view.

Download Isapi_rewrite ... (The compression package contains the pseudo-static configuration of Bo-blog 2.1, which can be used directly if the Bo-blog is installed)

650) this.width=650; "src=" Http://www.niuc.net/template/EleganX2/images/download.gif "alt=" download.gif "/> Download file (Downloaded 443 times) Click here to download the file: Isapi_rewrite.rar



can also be downloaded to the official: Http://www.isapirewrite.com/download/isapi_rwl_0049.msi

two. Configuring the system Environment

1. Install and configure MySQL
Unzip MySQL, then run directly ...


Select "Custom" to customize the installation,


Click "Change" to make changes to the MySQL installation directory (if necessary),


After the file copy is installed, proceed to the MySQL Setup screen and click "Finish".


Select "Detailed Configuration" to configure it in detail,


Select MySQL run mode as "Server machine:


Select MySQL database default storage is "Non-trans only" (MYISAM)


Set MySQL maximum connection number: An integer that is generally set to 128-512.


Set MySQL network parameters, note:do not enable "Strict Mode".


Set the MySQL default character set,subject to the language of the user site, such as Bo-blog version 2.1 is UTF8, then the database is selected UTF8,


Windows environment settings, the first entry is the name that is started as a service, the check box below asks whether to let the service run automatically, and the following "Include Bin Directory in Windows path" indicates whether to insert the MySQL path into the system variable, which is generally selected.


To modify the root user password, note:do not select "Create an Anonymous account", which is very unsafe for the database if you want to start anonymous remote connection mode,


Complete the MySQL installation and start the MySQL service.


2. Test MySQL

Open Start menu, select Run, enter cmd, and then enter "Mysql–u root–p" in the pop-up cmd form, enter the password that you set during the MySQL configuration process, and if it appears as follows, MySQL is configured correctly ...

Welcome to the MySQL Monitor. Commands End With; Or/g.
Your MySQL Connection ID is 8352
Server version:5.0.51a-community-nt MySQL Community Edition (GPL)

Type ' help; ' or '/h ' for help. Type '/C ' to clear the buffer.

Mysql>


3. Add PHP to the environment variable

Unzip PHP, this example is extracted to "d:/php" ...

Right-click "My Computer", "Properties", select "Advanced" tab, click "Environment Variables", click "Path" in the "System variables" list below, click "Edit" below "Variable value" to add ";D:/php" ( PHP decompression path, do not forget to add the ";", OK, click on the "Edit" button before the "New" button, "Variable name", enter "PHPRC", "Variable Value" input "d:/php" (PHP decompression path), click " OK "Finish ...

4. Modify the php.ini configuration file

Go to the "d:/php" folder and rename "Php.ini-dist" to PHP.ini

Click "Start" menu, select "Run", enter "php.ini"--open php.ini (this is to test "environment variable" is set correctly, of course, you can directly double-click php.ini Open File ...) Oh

Then search "Extension_dir" to find Extension_dir = "./", and change to Extension_dir = "ext" (if you are afraid of configuration errors, you can directly click "Start", "Run", input "ext", OK, If you open a folder full of. dll, it proves that the environment variable is configured correctly)

Search for "Windows Extensions"

In the dynamic module configuration under Windows Extensions, you need to open the following module support: (Remove the ";" in front of each line of the module configuration. Number can be)

Extension=php_mbstring.dll
Extension=php_gd2.dll
Extension=php_mysql.dll


It is recommended that advanced users (familiar with PHP functions) find "disable_functions =" and add the following PHP functions, such as "shell_exec", "exec", "Scandir" and so on.General user can leave blank ...

5. Create a website

Click Start, select Run, enter inetmgr (or open Control Panel, select Administrative Tools, select Internet Information Services (IIS) manager), start IIS Manager, expand the tree directory on the left, right-click the Web , select New to establish a Web site (or a virtual host),



Enter the site name as an identity in IIS and can be entered arbitrarily,


The website IP address does not need to fill in, the port if does not have the special request to maintain "80", finally "this website's main head" under correctly enters the website domain name,


Create a directory in the hard disk partition, and specify that the recommended site is placed in a separate partition (in this case "E:/wwwroot/web" for the Site directory), and determine the path below the "Allow anonymous access to the site" is selected.


For PHP applications, you need to give the site "read" and "Run Script" permissions.


At this point, a new site has been successfully created,


6.IIS and PHP Integrated configuration-Enables the site to support PHP

Expand the tree directory on the left, find the site you just created "Phpsite", right-click to select "Properties",


In the Site Properties window, click the Home Directory tab, click the Configure button, in the New Application Configuration dialog box that pops up, click the Add button, join PHP's ISAPI support, and select "Executable" as "D:/php/php5isapi.dll" ( PHP directory (Php5isapi.dll), with the extension ". php" (Please do not forget the previous one "."), "Limit action" to "Get,post", click OK to add, and in the Application Extensions window, see if the ". PHP" extension was loaded successfully. If successful, click OK to close the configuration window and back to the Site Properties main window.


Click on the "Document" tab, in the "Default content document" according to the first page name of the site program to add the corresponding name, generally "index.php", if there is static, may contain "index.htm", "index.html", add them all to the list, when done, click " OK, close the Site Properties Configuration window and go back to the IIS manager main interface.


Expand the tree directory to the left of the organizer, right-click Web Service Extensions, select Add a new Web service extension,


In the New Web Service Extension dialog box shown, "Extension" fills in PHP, "file" selects "D:/php/php5isapi.dll", and the PHP extension is setThe default is allow.


Restart the IIS service,



Here, IIS and PHP are integrated ...

7. Test if PHP is normal

Go to the "e:/wwwroot/web" directory, create a new text file, and enter the following code in it:

<?php
Phpinfo ();
?>


Save and change the file name to "info.php".

If you find that you cannot change the extension, click on the "Tools" menu in any one of the Windows Forms menu bar, select "Folder Options", click "View" tab, and in "Advanced settings" find the "Hide extensions of known file types" in front of the check box to remove, click "OK" closes,


Open IE Browser, input: http://www.youdomain.com/info.php, if the ability to display the PHP support information correctly indicates that the configuration integration is successful.

8. Installing the Zend Optimizer optimizer

Double-click the downloaded zendoptimizer installation file, the installation process is very friendly and simple, so this is no longer explained here.

However, the following points should be noted:

When you are prompted for the location of the php.ini during the installation process, select the PHP directory, in this case, "d:/php".

The location of the IIS Web site root directory is prompted during the installation, in this case "E:/wwwroot"

Zend Optimizer automatically restarts the IIS service after the installation is complete, restart the Internet Explorer window after reboot, view info.php support information, see if Zend Optimizer support information is included, if not, then Zend Optimizer No installation succeeded, Zend optimizer support information


9. Installing the XCache cache

Unzip the XCache and putPhp_xcache.dllPlaced inphp.ini in the specified Extension_dir (this example is "D:/php/ext").

Start configuration below, open php.ini

Add (remember to add, do not replace the original zend_extension_ts parameter)
Zend_extension_ts = "($extension _dir)/php_xcache.dll "

I configure the time, the ($extension _dir) to replace the absolute path ext (because the environment variable, so the direct use of Ext on the line, do not need to enter the path) only line.

Add the following items to the end of php.ini and you can copy the following configuration directly ...

[Xcache.admin]
Xcache.admin.enable_auth =Off
Xcache.admin.user = "UserName"
Xcache.admin.pass = "PassWord"
[XCache]
Xcache.shm_scheme = "Mmap"
Xcache.size =64M
Xcache.count =4
Xcache.slots =64K
Xcache.ttl = 1800
Xcache.gc_interval = 1800
Xcache.var_size =8M
Xcache.var_count =4
Xcache.var_slots =64K
Xcache.var_ttl = 0
Xcache.var_maxttl = 0
Xcache.var_gc_interval = 300
Xcache.test = Off
Xcache.readonly_protection = Off
Xcache.mmap_path = "XCache"
Xcache.coredump_directory = ""
Xcache.cacher = On
Xcache.stat = Off
Xcache.optimizer =Off
[Xcache.coverager]
Xcache.coverager = Off
Xcache.coveragedump_directory = ""

The value that needs to be modified is already usedBlueTo be marked, the following is stated:

Xcache.admin.enable_auth XCache Background need to verify (this background in the XCache just download the admin directory, you can freely handle, if not required, set to OFF)
Xcache.admin.user XCache Background Login user name
Xcache.admin.pass XCache Background Login password
Xcache.size XCache Memory Cache size, the normal site is recommended to set to 64MB, if it is IDC server, can be set to 256MB
Xcache.count set to the number of CPUs (double accounting 2, for example, I am two dual-core Xeon 3.0, set to 4)
Xcache.var_size
Xcache.var_count the same as two bars.
Xcache.mmap_path Shared Memory ID name, try to use XCache, avoid conflicts with other software
Xcache.optimizer Optimizer, if not installed Zend can be turned on, above we have installed Zend, so set to off

Now that the configuration is complete, you can restart IIS ...

Then open info.php again, look for "XCache", if you find the relevant XCache information, that represents the correct configuration ... The relevant information is as follows (as shown in the figure will vary depending on the configuration of the parameters):


If you do not find it, try the 3rd in the following troubleshooter ...

As for why not extension, and use Zend_extension_ts, because this release version of the XCache interface is ZEND_API, directly with the extension can not initialize.

XCache Troubleshooting

1.phpinfo () shows no load Php_xcache.dll
Check that the NTFS permissions for Php_xcache.dll are correct and that you need to give the site user (or guests) read-only permission.

2. A PHP memory error occurred
Using the extension call Php_xcache.dll, try using Zend_extension_ts.

3. Open the Web page is not responding, errors Fatal error: [Zend Optimizer] Zend Optimizer * * are incompatible with XCache 1.2.2
This is due to the installation of Zend, the workaround is simple, put the call Php_xcache.dll Zend_extension_ts mentioned before the call Zend.
zend_extension_manager.optimizer_ts= "D:/program files/zend/zendoptimizer-3.3.0/lib/optimizer-3.3.0"
Zend_extension_ts= "C:/php/ext/php_xcache.dll"
zend_extension_ts= "C:/Program Files/zend/zendoptimizer-3.3.0/lib/zendextensionmanager.dll"

The XCache cache configuration is complete ...

10. Installing the Isapi_rewrite URL pseudo-static module

Want to know the URL pseudo-static description and for the impact of SEO, please go to http://www.niuc.net/post/44/view ...

Configuration method under IIS: Open Internet Information Services (IIS) management, right-click Phpsite, select Properties, click ISAPI Filters tab, click Add Filter, Name fill in the rewrite-> path and specify "Isapi_rewrite.dll" (at the root of the Isapi_rewrite), click OK.

Then configure the Isapi_rewrite, open the Isapi_rewrite directory, open the "Httpd.ini", in the inside of the configuration corresponding to your website program (this site download Isapi_rewrite contains Bo-blog 2.1 of the configuration file, can be used directly) , configure yourself according to the website program in Baidu or Google search it ... If you are writing a website program, please write your own configuration file ...

Restart IIS (the restart method is given above), configuration complete ... Then go to the corresponding website program to open the corresponding options ...

So far ... All the configuration has been completed successfully, if you have any questions or comments, please leave a message ... Thank you for watching ... Hope to help you ...

PS. The above process is part of the user manual from Discuz ...

This article is from the "→おyǒňɡ Zhi ℃" blog, please be sure to keep this source http://lxxxker.blog.51cto.com/4244111/1413439

Related Article

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.