Schematic win2003+iis6+php+gd2+mysql installation configuration

Source: Internet
Author: User
Due to the use of Windows2003 server more and more users, and some of the best programs are developed by PHP, so, this talk about window2003 under the installation and configuration of PHP, and 2003 permissions settings and other issues!

2003 and IIS6 installation here will not talk about, if you do not install Win2003 and IIS6, it is best to first look at other articles to install the system and components learned to look at the following is not too late!


######################
First: Install PHP
#####################

1, download PHP installation program http://www.php.net/downloads.php,
The latest version of the PHP installation for php5.1 Windows is divided into two ways, one is the source code installation method, an EXE installation method, EXE installation method for the idiot-type installation, double-click to install, we do not talk about, the main point of the source code installation!

Download "PHP 4.3.10 Zip package" or 5.0 or 5.1. Then unzip the downloaded zip file to
C:\php (can be extracted according to different needs to different directories, but not familiar with the default, can not occupy much space).


2, copy C:\php\php4ts.dll to C:\Windows\System32. (sometimes for convenience, click Search *.dll in the PHP folder to copy all the folders you have searched to System32, so you can save a lot of trouble!) )


Copy the c:\php\php.ini-recommended (or php.ini-dist) to C:\windows\php.ini and then open the C:\windows\php.ini, modifying the following several places:

; If you use the default of 4096, then PHP will have a very bad performance inside IIS6.
Output_buffering = On

; If it is on the production server, you can not modify the following two lines
Error_reporting=e_all & ~e_notice
Display_errors = On (here is the error to modify PHP, off is not prompted, some database links non-error information will also be PHP as error message output, recommended as a Web server shutdown!) )

; Indicates the folder where the PHP extension library resides
Extension_dir= "C:\php\extensions" (Here is the Ext folder in PHP5, different versions, that is, the folder where the DLL files are placed)

The following two are time-outs: General 60-120
Max_execution_time = 90
Max_input_time = 90
Post_max_size = 8M (6-10m best)
Upload_max_filesize = 8M (maximum upload attachment size)

Default_socket_timeout = 90 (port time 60-120)

Session.gc_maxlifetime = 3600 (session default time to live, seconds)
Session.save_path = "C:\PHP\sessiondata" (here to modify the session's storage directory, if you do not need the session function, you can also do not modify, note that the directory must exist, does not exist to establish)
The other settings are modified to suit your needs. Having done this, the first part is finished.


######################
Second: Configure PHP in IIS
#####################

1. Install IIS first through the "Add or Remove Roles" feature in the Manage Your Server Wizard. In Windows Server 2003, IIS is referred to as an "application server." You can select the options such as ASP if you want to install. But even if not selected, it can be very convenient to enable later.



(Figure 02_01: Install IIS)

2. In the "Manage Your Server" wizard, click on the "Manage this application Server" connection to open the "Application Server" Management window. Then select "Internet Information Services (IIS) Manager, local computer->web service extensions" from the left. Then select any one of the items on the right. Click on the "Add a new Web service extension" connection.

Enter the extension and click the "Add" button to add the C:\php\sapi\php4isapi.dll (sometimes the ISAPI file may also be under c:\php) file to the list. Attention is Php4isapi.dll, not php4ts.dll.

Finally, select "Set extended status to allow" and click the "OK" button to close the dialog box. You should now see the item you just added in the Web service Extensions list.


(Note that the picture is from the network, the path in the picture is inconsistent with the path in this article!) Same below
(Note: PHP parsing is divided into two modes, CGI and ISAPI two, if you choose Php_cgi.exe here, then step 3 must be consistent!) )

(Figure 02_02: Add an extension of PHP4)

3. Select Internet Information Services (IIS) Manager, Web site, from the left side of the Application Server Management window. Then right-click the Default Web site item and select Properties to open the Default Web Site Properties dialog box.

Switch to the Home Directory tab and click the Configure button to open the Application Configuration dialog box. Then click on the "Add" button to open the "Add/Edit Application Extension Mapping" dialog box.

Click the "Browse" button, select C:php\sapi\php4isapi.dll, and follow the options in (Figure 03) to set it up. The last "OK" returns to the Default Web Site Properties dialog box.



(Figure 02_03: Add application Extension mappings)

4. Switch to the "Documents" tab and click the "Add" button to add index.html and index.php to the list of default content documents. Finally, confirm the close dialog box.



(Figure 02_04: Adding a default document)


######################
Third: Verifying the installation
#####################

Write a few lines of code in Notepad:

Save as phpinfo.php file in the root directory of the Web site. Then launch the browser, Access http://xxx.aaa.com/phpinfo.php, if you see the following screen to prove that PHP installed successfully!



(Figure 03_01: Check if PHP is installed successfully)


######################
IV: About Permissions
#####################

Windows2003 and other systems in order to file installation using NTFS format, and IIS6 can assign each virtual host a different user to anonymously access the site, if you have done as set up, then you test the installation of PHP may appear prompted to enter the user name, the solution:

Please make sure that users who access this virtual host have read and execute permissions to the site and directory!

In IIS management of the appropriate virtual host, right-click Properties View, Directory Security tab, anonymous access and authentication control to see the users allowed to access, and let users have read and write access to c:\php

If you have multiple virtual hosts on your console, and each user accesses the site using a different user name, it is best to add all users to the same group, so that the group has read and write access to the PHP folder!


After the modification, prompt to enter the user name and password window should have been removed!!


######################
IV: MySQL installation and GD2 support
#####################

First download the MySQL installation files, MySQL in the win installation is generally used EXE installation files, so, here is not introduced installed!

PHP after installation is not supported by default read MySQL, we want to modify the php.ini file, the

Extension=php_mysql.dll
Extension=php_gd2.dll
In front of the ";" Remove, note, in order to let PHP support to generate true color pictures, generally require support gd2,extension=php_gd2.dll that is supported GD2 DLL files.


Note that the previous version of PHP5 is not supported by default after the mysql4.1 password access format, in the MySQL use the following command, the password is unified a bit:
Set PassWord for ' username ' @ ' hostname ' =old_password (' PassWord ');

This will be a smooth connection to MySQL! Or simply install the PHP5 directly!

Thanks to the picture Author!

Have questions welcome advice!
  • 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.