[Original]windows2003 manual Installation configuration php5 detailed guide

Source: Internet
Author: User
Tags filter copy manual install php iis ini variables zip
php5|window|windows2003| Original

Today, the server for the configuration of PHP environment, the first in Baidu to collect some relevant information for reference, and then began to manually configure the PHP5 environment (personal more like green without installation of things).

There are two ways to install PHP in a Windows environment: Manually configuring the environment or installing with a PHP installation package. According to the PHP official manual, the best option for installing PHP is to install it manually. The best way to install PHP in a manual installation is to put all PHP-related files into the same directory and set this directory in the system's PATH environment variable.

In the Windows environment configuration PHP5, you must understand the functions of these two nouns:
ISAPI (Internet Server application program Interface): The Internet Server Application programming interface.
CGI (Common Gateway Interface): Universal Gateway Interface

1, the introduction uses the Setup program to install:
PHP's Windows installer can be downloaded at http://www.php.net/downloads.php. Click on the Windows Binaries PHP 5.2.2 Installer (choose the latest version) to download. It installs the CGI version of PHP for IIS, PWS, and Xitami, and configures the Web server. The installer does not contain any external PHP extensions (Php_*.dll). If needed, it can be found in Windows ZIP packages and PECL.
Note: Although Windows installer is the easiest way to make PHP work, it has many limitations. For example, it does not support the automatic installation of PHP extensions. Installing PHP with Setup is not the best way to do this.
Warning: Please note that this installation of PHP is not secure. If you need a secure PHP setting, it's a good idea to install it manually and set each option manually. This automatic installer allows users to use PHP immediately, but that does not mean they can be used on an online server.

2, the introduction of the use of compressed packaging for manual installation:
PHP Manual installer can be downloaded in http://www.php.net/downloads.php . Click PHP 5.2.2 Zip package to download.

      Note: While there are many more than one installation packages and a Microsoft Windows PHP installer, it is still recommended that users take the time to manually install PHP themselves. Because this will be more understanding of this system, and can be more convenient to install the PHP extension when needed. At the same time, server modules provide better performance and more functionality than CGI executables. The CLI version is designed for use with PHP command-line scripts. Both CGI and CLI executables, as well as Web server modules, require Php5ts.dll. You must confirm that the file can be found in the PHP installation path. The search order for the DLL is:
1, the directory where the Php.exe is invoked, or the directory of the Web server (for example, C:\Program Files\apache group\apache2\bin) If the SAPI module is used.
2, any directory specified in the Windows PATH environment variable.
  
To allow php5ts.dll to be searched correctly, there are three ways:
1, Copy the file to the Windows system directory
2, Copy the file to the Web server directory
3, or add a PHP directory (such as D:\PHP5) to the PATH environment variable.

For better maintenance in the future, it is recommended that you use the last option to add the PHP directory to the PATH environment variable because it makes it easier to upgrade PHP in the future.

Here's a step-by-step installation configuration PHP5 environment:

The first step: direct decompression into the D disk PHP5 directory.
  Step Two: Add the PHP directory to the PATH environment variable
Right-click on my Computer to open the Properties page, select the Advanced tab, click on the "Environment variables" button and locate the path in the System variables column (you may need to scroll down to find the scroll bar), double-click the path, and add the PHP directory at the end, including the preceding ";" (such as:;D: \PHP5), click "OK";
  Step three: set up a valid configuration file for PHP, php.ini.
There are two INI files in the ZIP package, Php.ini-dist and php.ini-recommended. Php.ini-recommended is recommended because performance and security are optimized in this file. Please read the comments in the file carefully, as it is modified from php.ini-dist and will have a significant effect on the settings. For example, set Display_errors to off and MAGIC_QUOTES_GPC to off. In addition to reading these sections, you can also learn about the INI settings and manually set up each configuration item. If you want the safest settings, this is the best way to do it, although PHP is also safe under the default configuration. Copy the selected INI file to the directory that PHP can find and rename it to PHP.ini.

First rename the D:\PHP5\php.ini-recommended to php.ini. Then use Notepad to open the php.ini, look for register_globals = off, change off to on, and then look for short_open_tag = off, and turn off to on, which can generally solve the problem of white space when running the installation discuz! forum.
And then look for extension_dir = "./" To Extension_dir = "D:\PHP5\ext" (Specify the directory of the Dynamic Connection library, PHP5 and PHP4 the difference is that its dynamic connection library directory has changed, which is described in detail in its document structure)
Then look for the following string and remove the semicolon before the code.

Extension=php_mbstring.dll This is not a choice, with phpMyAdmin will appear red hint
Extension=php_dba.dll
Extension=php_dbase.dll
Extension=php_filepro.dll Optional
Extension=php_gd2.dll Support GD Library, the general to drop
Extension=php_imap.dll Optional
Extension=php_ldap.dll
Extension=php_mysql.dll support for MySQL

Next, some file uploads and maximum memory usage restrictions are modified:
Memory_limit = 20M Memory capacity
Post_max_size = 20M Flash capacity
Upload_max_filesize = 20M Attachment capacity

Save the close file after you modify it.

   Fourth Step:Make php.ini files available to PHP under Windows:
Right-click on my Computer to open the Properties page, select the Advanced tab, click on the "Environment variables" button, and in the System Variables column, click the "New" button and enter "PHPRC" in "Variable name", and enter the directory where the php.ini file is located in "Variable value" (For example: D:\ PHP5), click "OK"

Fifth Step:Configure IIS so that it supports PHP
You must first determine that IIS is installed correctly on your system, and if it is not installed, you need to install IIS first.
When PHP consolidates with IIS, it supports both CGI and ISAPI two modes, and it is recommended to use ISAPI mode. This only explains the ISAPI mode installation method: ISAPI mode installation steps:
In Control Panel, in Administrative Tools, select Internet Services Manager. Stop the service after you turn on IIS, and then on the left "you need to support PHP on the Web site by right-clicking on the" Properties "and clicking in the ISAPI Filter tab of the Open Web Site Properties window Add button, enter PHP in the Filter Name field in the Pop-up Filter Properties window, and then point the executable file to the path where Php5isapi.dll is located, such as: D:\PHP5\php5isapi.dll.
Open the Home Directory tab of the Web Site Properties window, locate and click the "Configure" button, locate and click the "Add" button in the pop-up Application Configuration window, add an extension map to the pop-up window, and click Browse to point the executable file to Php5isapi.dll path, such as: C:\PHP\php5isapi.dll, and then all the way OK.
Open the document tab of the Web Site Properties window again, and then locate and click the Add button to add the index.php entry to the default Web site startup document list. You can raise the index.php to the highest priority so that the index.php document is automatically searched and opened first when you visit the site.
Determine the application settings and execution permissions for the Web directory, select as pure script, and then restart the IIS service.

Sixth step:Configure Web Service extensions for IIS.
For security reasons, we do not recommend allowing all the knowledge-seeking ISAPI extensions in the Web server extensions.
New Web service extension, extension. PHP, required file Php5isapi.dll, set extension status to allow. Many netizens are reflected in the WINDOWS2003 configuration PHP5 failure because this step is not set.

Friends who have previously installed PHP will copy all files under D:\PHP5 and D:\PHP5\ext to DLLs under C:\WINDOWS\system32 and under D:\PHP5 Php.exe, Php-win.exe, Php.ini-dist copied to the C:\WINDOWS. This may cause problems when you run your PHP program.

If you want to make a more detailed parameter configuration, we recommend that you check the relevant PHP5 configuration manual and then make changes, you can also click here to visit this site PHP installation and configuration tutorial Daquan http://www.alixixi.com/program/Web/PHP/php7/ Understand the relevant technical articles.



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.