Teach you IIS6 the best way to configure PHP _php tutorial

Source: Internet
Author: User
Tags sapi hosting web hosting
Although the LAMP combination is good, if you want to set up a web hosting server that supports PHP, ASP, ASP, JSP, Perl, or Windows 2003, IIS 6 is the best. There are a lot of articles on the web that describe the configuration of PHP on IIS 6, but those methods are not bad performance or upgrade trouble. The following method allows you to easily upgrade the first time you configure it.

The upgrade described here refers to upgrading from one PHP4 version to another PHP4 version, or upgrading from one PHP5 version to another PHP5 version, rather than upgrading from PHP4 to PHP5.

Get ready:

1, an installed Windows 2003 server, and IIS 6 is already installed.

2, download the Windows version of the PHP binary compression package

Installation:

Unzip the PHP binary compression package into the C:\php directory (assuming that the C: disk is the system disk, that is, the disk that installed the Windows system, if the system disk is D: disk, then unzip to the D:\php directory, and so on, and so on).

Then, under "System variables", "environment variables," such as "My Computer", "Properties", "Advanced", "," and "path", edit its value and add the following path address in front:

C:\php; C:\php\dlls; C:\php\extensions; C:\php\sapi;

Copy the Php.ini-dist or php.ini-recommended to the C:\Windows directory and rename it to php.ini, the server for the general official publishing site is php.ini-dist, and as a server for debugging php.ini-recommended better. Of course, in general, the php.ini still need to be modified according to the actual situation.

Here are a few of the necessary modification options:

Extension_dir = "C:\php\extensions"

This is the directory where the PHP extension is placed, make sure it is the same as the directory you are actually installing.

Extension=php_mbstring.dll

; Extension=php_big_int.dll

Extension=php_bz2.dll

Extension=php_cpdf.dll

Extension=php_crack.dll

Extension=php_curl.dll

Extension=php_db.dll

Extension=php_dba.dll

Extension=php_dbase.dll

Extension=php_dbx.dll

Extension=php_domxml.dll

; Extension=php_exif.dll

; Extension=php_fdf.dll

; Extension=php_filepro.dll

Extension=php_gd2.dll

Extension=php_gettext.dll

Extension=php_hyperwave.dll

Extension=php_iconv.dll

; Extension=php_ifx.dll

; Extension=php_iisfunc.dll

Extension=php_imap.dll

; Extension=php_interbase.dll

Extension=php_java.dll

Extension=php_ldap.dll

; Extension=php_mcrypt.dll

Extension=php_mhash.dll

Extension=php_mime_magic.dll

Extension=php_ming.dll

Extension=php_mssql.dll

Extension=php_msql.dll

; Extension=php_oci8.dll

Extension=php_openssl.dll

; Extension=php_oracle.dll

Extension=php_pdf.dll

Extension=php_pgsql.dll

; Extension=php_printer.dll

Extension=php_shmop.dll

; Extension=php_snmp.dll

Extension=php_sockets.dll

; Extension=php_sybase_ct.dll

Extension=php_w32api.dll

Extension=php_xmlrpc.dll

Extension=php_xslt.dll

Extension=php_yaz.dll

Extension=php_zip.dll

Above, the opening without a semicolon is an open extension, and a semicolon is an extension that is not open. The above settings include all extensions that can be opened (listed here in PHP 4) with the default installation on Windows 2003.

Session.save_path = C:\sessions

This is the default directory to save the session file, this directory must be an existing directory, or the default session function will be invalid. What I am setting here is a directory on a RAMDisk. Setting the Session.save_path on RAMDisk can speed up session processing. If you do not have RAMDisk installed, you can assign it to any directory of other disks, such as the C:\sessions directory, the C:\Windows\Temp directory, and so on.

OK, the basic work is done, now it's time to configure IIS.

Open Internet Information Services (IIS) Manager, in Web service extensions, select Add a new Web service extension, the extension can fill in the PHP ISAPI extension, the required file selection: C:\php\sapi\ Php4isapi.dll (if PHP5 is installed, this is C:\php\sapi\php5isapi.dll, below), and the extended state is set to allow.

Open site, properties, ISAPI filter, add, filter name can be filled with "PHP", executable files still choose C:\php\sapi\php4isapi.dll.

Open the Add, application extensions, configuration, application settings, home directory, properties, Web site, and the executable file or select C:\php\sapi\php4isapi.dll. The extension fills in ". Php", and the action is limited to "head,get,post".

You can add index.php as the default content document by opening the document, properties, Web site, enable default content document, and Add.

Then select "Server machine name", "All Tasks", "Restart IIS" to restart IIS.

Test

In the default Web site publishing directory, create a test page:

Download: phptest.php

Phpinfo ();

?>

If you open this page to see the PHP installation configuration information, even if the installation was successful.

If you want to optimize the execution of PHP programs, you can install Zendoptimizer-2.6.0-windows-i386.exe, this thing installation is very simple, here is not introduced.

Upgrade

The upgrade is now very simple. Just download the new version of the PHP binary package, delete the original C:\php directory, unzip the new version into the C:\php directory, and then restart IIS. You do not need to modify any configuration, nor do you need to copy any files to the System32 directory. Isn't it convenient?

http://www.bkjia.com/PHPjc/313884.html www.bkjia.com true http://www.bkjia.com/PHPjc/313884.html techarticle Although the LAMP combination is good, if you want to set up a web hosting server that supports PHP, ASP, ASP, JSP, Perl, or Windows 2003, IIS 6 is the best. Online has ...

  • Related Article

    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.