Win2003 IIS6.0+PHP+MySQL installation configuration

  
IIS+PHP+MySQL installation configuration There are two ways to install PHP under Windows: manual installation or installation using the installer. According to the official PHP 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 in the same directory and set this directory in your system's PATH environment variable. ISAPI (Internet Server Application Program Interface): The Internet server application programming interface. CGI (Common Gateway Interface): The Windows Installer for Universal Mail Interface Installer to install PHP can be downloaded at http://www.php.net/downloads.php. Click on PHP 5.1.2 installer 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). It can be found in the Windows ZIP package and PECL if needed. Note: Although the Windows Installer is the easiest way to get PHP to work, it has a lot of limitations. For example, it does not support automatic installation of PHP extensions. Installing PHP with the installer is not the best way. Warning: Please note that PHP installed in this installation is not secure. If you need a secure PHP setup, it's best to install it manually and manually set each option. The auto installer allows users to use PHP immediately, but that doesn't mean it can be used on an online server. Manual installation of PHP manually can be downloaded at http://www.php.net/downloads.php. Click on the PHP 5.1.2 zip package to download it. Although there are many all-in-one installation packages and a PHP installer for Microsoft Windows, it is still recommended that users take the time to manually install PHP. This is because you can get a better understanding of the system and be able to install PHP extensions more easily when needed. At the same time, server modules provide better performance and more functionality than CGI executables. The CLI version is designed to work with PHP command line scripts. Both the CGI and CLI executables and the web server module 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 php.exe is called, or the directory of the web server if the ISAPI module is used (for example, C:\\Program Files\\Apache Group\\Apache2\\bin). 2. Any directory specified in the Windows PATH environment variable. To make php5ts.dll searchable correctly, there are three options: copy the file to the Windows system directory, copy the file to the web server's directory, or add the PHP directory (eg d:\\PHP) to your PATH environment variable. in. For better maintenance in the future, it is recommended to use the last option to add the PHP directory to your PATH environment variable, as this makes it easier to upgrade PHP in the future. The following describes the manual installation steps of PHP: The first step: I directly put the decompression into the d disk PHP directory, so it is convenient to find the file. After unzipping, my PHP directory is d:\\PHP. Step 2: Add the PHP directory to your PATH environment variable, (My Computer -> Properties -> Advanced -> Environment Variables -> System Variables -> find the path variable, click Edit to add as follows d:\\php; is the path to install PHP. Note that there is a "circle separated by a semicolon" between each variable. If there is no semicolon in the front, please add it. -> all the way) Please pay attention Demo, if you don't understand friends, please refer to the attached DOC document. Step 3: Set a valid configuration file for PHP, php.ini. There are two ini files in the ZIP package, php.ini-dist and php.ini-recommended. It is recommended to use php.ini-recommended because performance and security are optimized in this file. Please read the comments in this file carefully as it is modified from php.ini-dist and will have a large impact 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. This is the best way to get the most secure settings, although PHP is also safe in the default configuration. First rename D:\\PHP\\php.ini-recommended to php.ini . Then open the php.ini with Notepad, look for register_globals = Off, change the off to On (there are two places) here can generally solve the problem of running blank when running the forum. Then look for short_open_tag = Off, change off to On, and then look for extension_dir = "./" to extension_dir = "d:\\PHP\\ext" (specify the directory of the dynamic link library, php5 and php4 are different The place is that its dynamic link library directory has changed, which has a detailed description in its document structure) and then look for; extension=php_mbstring.dll, remove the extension from the following sentence to the extension=php_mbstring.dll. If you use phpMyAdmin, you will get a red prompt extension=php_dba.dllextension=php_dbase.dllextension=php_filepro.dll Optional extension=php_gd2.dll Support GD library, generally dropex=php_imap.dll Optional extension=php_ldap.dllextension=php_mysql. The dll support MySQL next modified some file upload and memory usage maximum limit: memory_limit = 20M memory capacity post_max_size = 20M flash capacity upload_max_filesize = 20M attachment capacity above 3 places, please modify other according to their actual needs, no change What, save and exit. Step 4: Make the php.ini file used by PHP under Windows, (My Computer -> Properties -> Advanced -> Environment Variables -> System Variables -> Click “ Add & rdquo; -> Variable name “PHPRC”->variable value“D:\\PHP;”that is, the path where you installed PHP-> all the way OK================== =========================================================== =========Special Note: The following steps (first-time installation of friends do not need this step) friends who have previously installed PHP, will be under D:\\PHP and D:\\PHP\\ext all suffixes Copy the DLL file to C:\\WINDOWS\\system32 and copy php.exe, php-win.exe, php.ini-dist under D:\\PHP to C:\\WINDOWS. There may be some special faults when installing PHPWIND, then try repeating. Copy all files with the suffix DLL under D:\\PHP and D:\\PHP\\ext to C:\\WINDOWS\\system32 and php.exe, php-win.exe, php.ini under D:\\PHP Copy to C:\\WINDOWS. The above steps (the first time the friend does not need this step) ============================================== ==================================================================================================== Operation. Open the internet information service manager, enter the management of the IIS site and add a new ISAPI filter name. We can enter one at random. For future convenience, I typed in php, and rotate the location of the php5isapi.dll file below. Open the main directory tab. Click Configure. In the cache ISAPI application, create a new executable file with the extension .PHP. We still select the location of the php5isapi.dll file. OK! Restart the IIS Service Manager. Now our IIS has been able to parse the .PHP file. Create a new file with Notepad, enter the file content: <?phpphpinfo();?> Save as Phpinfo.php and enter http:/in the browser address bar. /localhost/Phpinfo.php Test if PHP is installed and running. If the installation is successful, it will display the current PHP related information. If it cannot be opened, prompt file download or 404 error, please check the above steps. Note: If you are a WINDOWS 2003 system, you need to expand it in the web application. Add a new extension and see the location of the php5isapi.dll file in the demo. Previously, some friends would choose "all unknown ISAPI extensions to allow" actually we are doing this now more securely.
Copyright © Windows knowledge All Rights Reserved