First step: decompression
Download the PHP's compression package, the first thing you have to do is decompressed, which is put on all files required to run PHP - including scripting execution engines, some extensions, dynamic connection libraries, etc. Step 2: Configure php.ini
Copy all files in the decompressed folder to a directory you want to install (such as C: / PHP4), after completing this step, you open the C: / PHP4 directory, you should see a file: PHP. Ini-dist, this is the PHP configuration file. Now you need to open and edit this file, pay attention, now this file extension is .ini-dist, you need to modify the extension to .ini, and notepad open. Once opened, you will see many options - but you need to modify the options very limited. 1. First, find (recommended to use Notepad's lookup feature) short_open_tag = this place, this place is used to set the Short mark as a tag that PHP code begins. It means that the PHP code is embedded in the HTML code in the future, and what tag will be used, this is similar to the "% of the ASP. If this item is set to OFF, only the PHP so long mark is allowed to start the label started by the PHP code. If set to ON, you can use any of Or Php. 2, find the register_globals = item. This project is quite important. Many PHP beginners will plant heads in this place. This means setting whether to automatically register global variables - the specific instructions of this project, I will continue to post a detailed instructions later, now I just need to tell you, I suggest you set it to OFF. If it is OFF before, you don't need to make any modifications. 3, find include_path =, note: You have two places in this place, which is just the second place, that is, Windows: "/ Path1; / Path2" below, because the above is the UNIX system. Here, you want you to fill in the default lookup path of the PHP containing files. We just copied the PHP file in C: / PHP4, so, it is necessary to modify its value to: "c: / php4 / incrudes", should be this after modification: include_path = "c: / php4 / incruDes" 4, Find extension_dir =, modify its value to "C: / PHP4 / Extensions". This is the lookup path of the extension file. 5. Find file_uploads =, as well as the following two consecutive UPLOAD_TMP_DIR and UPLOAD_MAX_FILESIZE, which is used to set up the file upload. It means: whether or not file upload (on / off), the temporary path of the upload file, the maximum number of bytes of the upload file. You can modify and fill in according to your needs, or you can use the default. UPLOAD_TMP_DIR recommends that you are filled in to ensure that the upload file is correct, we assume that you will put a temporary file in C: / New, you can fill in: UPLOAD_TMP_DIR = "C: / TEMP". 6. Find session.save_path =, this option is also one of more important options. Many friends have problems when using session, probably is not good. This represents the save path of the session, we can set it to: "C: / Temp", so that the server will put each session in this directory. Then look down, find session.auto_start =, we strongly recommend that you set it to 1, this means that the session is allowed to start.
If set to 1, your server starts, automatically supports session, you can open it when you write the code. If set to 0, you need to manually open. For beginners, we recommend setting to 1. The third step copy file is configured in this file php.ini, copy this file to the system directory, Win2000 is C: / WinNT /, Win XP is C: / Windows (of course, sometimes the directory name is not complete, but must be To copy it to the system directory). In this way, this file will be loaded automatically by the server. Then copy the PHP4TS.DLL of the following C: / PHP4 / below to C: / WinNT / System32 (or C: / Windows / System), if your machine has both system32 folders, and SYSTEM Folder, you can copy one for each folder.
Fourth steps and IIS established associations
Open the Internet information service inside "Administrative Tool" (XP system needs to be found from the Control Panel -> Management Tool), in short, the IIS manager, find the "default site" -> property, select the "Main Directory" tab, click below "Configuration" button, go to the Application Configuration window, select the Mapping tab, and click the "Add" button. Let's add a map of the .php file extension. In the window that opens "Add, Delete Application Extension Mappings", select "Browse" in "Executable File", find the "c: / php4/sapi/php4isapi.dll" (if you open this Directory, did not find this file, one must be that you don't have the file type "all files" or .dll files in the Open File dialog box, then fill in the PHP file you want in the "extension" below. Extension, you can use ".php", "pHP4", etc. Also pay attention to the following "Scripting Engine" to check in. Thus later, click "OK" to close all windows, turn off the IIS manager, and your PHP configuration is complete! ! Of course, you can set up index.php, default.php files such as Index.php, Default.php in the Manager "Document" tab as the default home page. The fifth step restarts IIS and tests this, and your PHP has been fully configured. You must be eager to try, you want to prepare a PHP program immediately, don't worry. Now you need to complete the last one - restart IIS. You can restart your machine directly. If you don't want to restart your machine, you can restart IIS: Enter the "Command Prompt", type: Net Stop Iisadmin Enter, after the service stops successfully, type NET START W3SVC Enter If prompt starts success, then your IIS It has been restarted. Now you can write your first PHP program! ! Create a text file, type the following code: Php echo phpinfo ();?> Then save this file to your home directory or a virtual directory, named show_info.php (name is arbitrary, but the extension must Is your PHP file extension), I assume that you save this file to your machine's MyPHP virtual directory, then you can now open your browser, type the address: http://127.0.0.1/myphp/show_info.php At this time, if you see the output of the PHP version information and configuration information, congratulations, you have succeeded! ! !