Installation and configuration of PHP5 and Apache under Windows

Source: Internet
Author: User
Here take PHP5 as an example of how to install and configure Apache and PHP5 under Windows.
Download installation program
Apache can download from http://www.apache.org/dyn/closer.cgi/httpd/binaries/win32/
PHP can be downloaded from the http://www.php.net.
Two setup programs
1, the Apache program is relatively simple to install, we are down from the site is a Windows installation program, we can double-click directly to run, so we will facilitate the Apache in our computers on the home.
2, we have to pay attention here is to download PHP when you must download the ZIP package, and do not download installer. Unzip our downloaded PHP package to the root directory under C disk and rename the extracted folder to PHP.
Three configurations
1, preferably, regardless of the interface (CGI or SAPI) you use to ensure that Php5ts.dll is available, you must place this file in the Windows path. The best location is the Windows system directory:
C:windowssystem for Windows 9x/me
C:winntsystem32 for Windows nt/2000 or c:winnt40system32 for Windows nt/2000 Server Edition
C:windowssystem32 for Windows XP
2, the next step is to set up a valid PHP configuration file, php.ini. The compressed package includes two INI files, php.ini-dist and php.ini-recommended. It is recommended that you use php.ini-recommended, because this file performs performance and security optimizations on the default settings.
Copy the selected INI file to the directory that PHP can find and rename it to PHP.ini. PHP defaults to search for php.ini in Windows directory:
3 Copy the selected INI file to%WINDIR% under Windows 9x/me/xp, usually c:windows.
Copy the selected INI file under Windows nt/2000 to%WINDIR% or%SYSTEMROOT%, typically c:winnt or C:WINNT40 corresponds to the server version.
4 the PHP settings in Apache
There are two ways to make PHP work under Windows Apache. One is to use CGI binaries, and the other is to use the Apache module DLL. Either way, you must first stop the Apache server and then edit the httpd.conf to configure Apache and PHP to work together.
If we were to use a CGI binary, we would insert the following instruction into Apache's httpd.conf configuration file to set up the CGI binaries:
PHP is installed in CGI to Apache 2.0:
scriptalias/php/"c:/php/"
AddType application/x-httpd-php. php

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.