Your location:Tech News>OS>Window 2003>Win2003 IIS6.0+PHP+MySQL Installation and Configuration

Latest News

Win2003 IIS6.0+PHP+MySQL Installation and Configuration

Author:fsadmin

Views:

IIS+PHP+MySQL Installation and Configuration

There are two ways to install PHP under Windows: manual installation or using the installer. According to the official PHP manual the best option to install PHP is to install it manually. The best way to install PHP in manual installation is to put all PHP-related files in the same directory and set this directory in the system's PATH environment variable.
ISAPI (Internet Server Application Program Interface): Internet server application programming interface.
CGI (Common Gateway Interface): the universal gateway interface
installer installation
PHP's Windows installer can be downloaded at ://.php.net/downloads.php.
Click PHP 5.1.2 installer to download.
It will install the CGI version of PHP for IIS PWS and Xitami and configure the web server.
The installer does not contain any external PHP extensions (PHP_*.dll).
If needed it can be found in the Windows ZIP package and PECL.
Note: Although the Windows installer is the easiest way to make PHP work it has many limitations.
For example it does not support automatic installation of PHP extensions. Using the installer to install PHP is not the best way. Warning: Please note that PHP installed by this installation method is not safe.
If you need a safe PHP setup it’s best to install it manually and set each option manually.
The automatic installation program allows users to use PHP immediately but this does not mean that it can be used in online servers. Manual installation
The manual installation program of PHP can be downloaded at ://.php.net/downloads.php. Click PHP 5.1.2 zip package to download. Although there are many all-in-one installation packages and a PHP installer for Microsoft Windows has also been released it is still recommended that users take some time to install PHP manually.
Because of this we can learn more about this system and install PHP extensions more conveniently when needed.
At the same time the server module provides better performance and more functions than CGI executable programs.
The CLI version is designed for using PHP command line scripts.
CGI and CLI executable files and web server modules all require php5ts.dll.
It must be confirmed 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 if the ISAPI module is used the directory of the web server (for example C:\\Program Files\\Apache Group\\Apache2 \\bin).  2 any directory specified in the PATH environment variable of Windows. To enable php5ts.dll to be searched correctly there are three options: copy the file to the Windows system directory copy the file to the web server directory or add the PHP directory (such as d:\\PHP) to the PATH environment variable in. For better maintenance in the future it is recommended to use the last option adding the PHP directory to the PATH environment variable because it is easier to upgrade PHP in the future.
The following describes the manual installation steps of PHP: The first step: I directly unzip it and put it in the PHP directory of disk d so it will be much easier to find files. After unzipping my PHP directory is d:\\PHP.
Step 2: Add the PHP directory to the PATH environment variable (My Computer -> Properties -> Advanced -> Environment Variables -> System Variables -> Find the variable path click Edit Add d:\\php; at the end which is the path where you installed PHP. Note that there is a semicolon between each variable. If there is no semicolon in front please add it. -> Make sure all the way ) Please pay attention to the demo. If you don’t understand please refer to the attached DOC document.
Step 3: 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. 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 because it is modified from php.ini-dist and will have a greater impact on the settings. For example set display_errors to off and magic_quotes_gpc to off. In addition to reading these parts you can also learn about ini settings and manually set each configuration item. If you want the most secure settings this is the best way although PHP is also very secure in its default configuration. Rename D:\\PHP\\php.ini-recommended to php.ini first. Then open php.ini with Notepad find register_globals = Off change off to On (there are two places) here it can usually solve the problem of blank when running the forum installation. Then search for short_open_tag = Off change off to On then search for extension_dir = \u0026quot;./\u0026quot; to extension_dir = \u0026quot;d:\\PHP\\ext\u0026quot; (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 is explained in detail in its document structure) and then search; extension=php_mbstring.dll remove the semicolon in front of the following sentences extension=php_mbstring.dllThis is not selected If you use phpMyAdmin a red prompt will appear
extension=php_dba.dll
extension=php_dbase.dll
extension=php_filepro.dll  optional
extension=php_gd2.dllsupports GD library Generally you need to drop
extension=php_imap.dll optional
extension=php_ldap.dll
extension=php_mysql.dll  Support MySQL. Next modify some file uploads and the maximum memory usage limit:
memory_limit = 20Mmemory capacity
post_max_size = 20M  flash memory capacity
upload_max_filesize = 20M  attachment capacity Please modify the above 3 places according to your actual needs and you will not change anything else. Save and exit.
Step 4: Make the php.ini file be used by PHP under Windows (My Computer->Properties->Advanced->Environmental Variables->System Variables->Click on \u0026ldquo;Add\u0026rdquo ;-\u0026gt;Variable name\u0026ldquo;PHPRC\u0026rdquo;-\u0026gt;Variable value\u0026ldquo;D:\\PHP;\u0026rdquo;That is the path where you installed PHP-\u0026gt; Make sure all the way)============= ================================================= ============= Special attention: the following steps (the friend who installed for the first time does not need this step) friends who have installed PHP before will download D:\\PHP and D:\\PHP\\ext Copy all files with the suffix DLL 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 failures when installing PHPWIND so please try to repeat. Copy all files with the suffix named DLL under D:\\PHP and D:\\PHP\\ext to C:\\WINDOWS\\system32 and php.exe php-win.exe php.ini under D:\\PHP Copy it to C:\\WINDOWS. The above steps (friends who install for the first time do not need this step) ==================================== =======================================
The variable setting takes effect after restarting the computer Then perform the following steps. 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 will. For the convenience of memory in the future I entered php. Rotate the location of the php5isapi.dll file below. Then open the home directory tab. Click Configure and create a new executable file with the extension .PHP in the cache ISAPI application. We still choose the location of the php5isapi.dll file. OK! Restart the IIS Service Manager .Now our IIS can parse the .PHP file.
Create a new file with Notepad and enter the content of the file: \u0026lt;?php
phpinfo();
?\u0026gt; Save it as Phpinfo.php and enter ://localhost/Phpinfo.php in the browser address bar to test whether PHP is successfully installed and running.
If the installation is successful the current PHP related information will be displayed. If it cannot be opened it prompts file download or 404 error please check the above steps! Note: If you are a WINDOWS 2003 system you also need to log in to the web application Add a new extension to the extension. Select the location of the php5isapi.dll file as shown in the demo. Some friends used to choose ``All unknown ISAPI extensions are allowed''. In fact it is safer to do this now.?win2003 server automatic restart command

Recommend article

Relate article