[Repost] Quickly build local WIN32 + IIS + PHP server

xiaoxiao2021-03-06  71

Built a PHP server on the Win32 platform, it is recommended to use IIS, perform efficiency than Apache.

Required related software download URL:

PHP 4.3.x Zip package

http://www.php.net/

PHP optimization program (optional)

Zend Optimizer 2.x

http://www.zend.com/

2. Turck MMCache 2.4.x

http://sourceforge.net/projects/turck-mmcache/

First, make sure IIS installed, if you don't have the IIS, the following is Win2000 as an example. Click "Start → Settings → Control Panel → Add / Remove Programs → Add / Delete Windows Components", then you can perform the first IIS on the first IIS. The WIN2000 CD is incremented by IIS5.0, and see the WIN2000 Help file for the configuration of the IIS server, which is not described here.

It is recommended to use the WIN2000 server version to do server because the professional version only allows 10 people to access.

Uploaded pictures

Unfaming the downloaded PHP compression package to your designated directory, here C: / PHP as an example.

Copy the php.ini-dist file under the C: / PHP directory to C: / Winnt and changed to PHP.INI, copy the php4ts.dll file to C: / Winnt / System32.

Use the text editor to open php.ini, do the following modifications:

Quote:

Original extension_dir = "./"; browscap = extra / browscap.ini; extension = php_gd2.dll

Quote:

Change to extension_dir = "c: / php / extensions" browscap = "c: /windows/system32/inetsrv/browscap.ini" extension = php_gd2.dll Note: extension = php_xxx is an extension module that enables some functions, no need Can be modified.

There are two ways to perform PHP on IIS:

1. Use ISAPI mode

2. Using CGI mode

The ISAPI mode is more efficient, and the stability is slightly. The settings of these two methods are similar, and the following is a detailed explanation of the ISAPI mode:

"Start" -> Program "-> Administrative Tools ->" Internet Service Manager ", right-click the" Default Site "icon, select the property, open the default website property, then select the" Main Directory "tab, click "Configuration". As shown below:

Uploaded pictures

After clicking "Configuration", a tab appears, which is the type of document already defined. Click the "Add" button, enter the following information in the dialog box, as shown in the figure:

Executable file: c: / php/sapi/php4isapi.dll

Extension: .php

Uploaded pictures

Next, select the "Document" page, you can see the list of documents such as "index.htm", click the "Add" button, enter "INDEX.PHP" in the Default Document Name, click "OK".

At this point, PHP has been installed. Simple test method:

Use Notepad to create 1 file, such as Test.txt, save the following: Save:

>

Return Test.txt to Test.php, move to your default website root directory, then enter: in IE address bar:

http://localhost/test.php If you can see the PHP test information as shown, it indicates that the PHP installation is successful.

Uploaded pictures

If you cannot run PHP using the ISAPI mode, you can try the CGI mode. The CGI mode is the same as the ISAPI mode, only one step is different, and the content of the 5th floor is changed to the following information:

Executable file: c: / php/php.exe

Extension: .php

After the PHP is installed, it will be optimized to improve the performance efficiency. This step does not require it, it does not affect the normal operation of PHP.

At the 1st floor, 2 excellent PHP optimization procedures Zend Optimizer and Turck MMCache can be used alone or 2. It is worth noting that if these two optimization programs are installed at the same time, Zend Optimizer should be installed after the Turck MMCache is installed.

Turck MMCache installation

Decompose the downloaded MMCache compression package, copy the mmcache.dll to the "C: / PHP / EXTENSIONS" directory.

Modify the php.ini file:

Quote:

Adding a row after the excenSion = php_xxx.dll mentioned earlier: extension = mmcache.dll Add: [mmcahe] mmcache.shm_size = "16" mmcache.cache_dir = "c: / windows / temp / mmcache "mmcache.enable =" 1 "mmcache.optimizer =" 1 "mmcache.check_mtime =" 1 "mmcache.debug =" 0 "mmcache.filter =" "mmcache.shm_max =" 0 "mmcache.shm_ttl =" 0 "MMCache .SHM_PRUNE_PERIOD = "0" mmcache.shm_only = "0" mmcache.compress = "1"

2. Installation of Zend Optimizer

The Zend Optimizer installation process is relatively simple, perform the downloaded installer, select the installation directory to automatically install. The installation directory is best with the PHP directory.

The picture below is the PHP information of the above two optimization programs, which can be seen that the display information is different from the 7th floor, increasing information that has been installed with Turck MMCache and Zend Optimizer.

Uploaded pictures

Win2003 is required to increase additional steps when installing PHP, except for the above Win2000 settings, and it also needs to be set in "Internet Service Manager". As shown below, right-click "Web Service Extensions" and select "Add A New Web Service Extension ...".

Uploaded pictures

Fill in the following information (ISAPI mode) in the window appearing:

Extension name: PHP-Isapi (any name you specify)

Required Files: C: /PHP/SAPI/php4isapi.dll

The following selection box is hooked.

Uploaded pictures

CGI mode

Uploaded pictures

转载请注明原文地址:https://www.9cbs.com/read-109413.html

New Post(0)