Mainstream Apache 2 PHP5 installation using introduction _php tutorial

Source: Internet
Author: User
We all know that Apache 2 and PHP are popular scenarios for creating interactive Web sites and are inexpensive. We are here on Apache 2 PHP5 installation and a detailed introduction to the small tricks, in the PHP 4.3 Manual of the Windows installation section, does not explain how to make Apache 2 PHP5 with the use of, and about Apache 2 PHP5 installation of the section missing you need a lot of information. Other installation guides published on the web include a number of errors that have allowed some installers to keep experimenting and making mistakes. For example, some people even replace PHP DLLs with other PHP versions of DLLs. OK, in order to save your valuable time, we have prepared this most authoritative guide article, help you to sweep away all troubles.

Using the correct version of Windows

The first thing to say is compatibility: Apache 2 cannot run on Windows 95; It is barely able to run on Windows 98, but it cannot be used as a service. Starting with version 4.3, PHP also no longer supports Windows 95. Therefore, your Windows operating system must be Windows NT, 2000, or XP.

Apache 2: source or binary?

If you have Visual C + + 5.0 or later, or if you have Microsoft Visual Studio installed, you can generate Apache based on the source code, but never do so. In the visual Studio IDE, the build process under Windows is very complex. Even compiling from the command line is definitely not an easy thing to do. So, unless you like to create makefile, it's a good idea to get a copy of the Windows Installer binary release package, which is an. msi file. When you have enough knowledge of Apache to know what custom actions you want to make, you can only consider generating (compiling) your own Apache.

If you have already installed and are running an older version of Apache, first stop it, uninstall it, and then start installing the new server. Multiple versions of Apache 2 cannot coexist.

Double-click the Apache 2. msi file. After agreeing to the license agreement, set the network domain and server Name correctly (if you do not intend to install Apache on the remote computer, then set up localhost), at administrator ' s Email Enter your e-mail address area to keep the port 80/Service option radio button selected. In the next dialog box, if you choose Typical installation, you can quickly get a server environment that can actually work.

Apache 2 PHP5 Installation Tips

It is recommended that you change the default installation directory from C:Program Filesapache group to C:apache or another name that matches the 8.3 file name format. This way, you do not have to add quotation marks each time you enter the Apache installation path.

After a while, the installation Wizard will tell you that the Apache 2 installation was successful. The only thing to do next is to test, open your browser and visit localhost, so you should see the default Apache 2 home page.

You can then delete all the sample files in the main Web server directory, which are in C:installdirectoryapacheapache2htdocs by default. If you have a ready-made homepage index.html, please copy it here; Alternatively, you can create a blank home page right away. For uninitialized HTML, the following code is available:

 
 
  1. <html>
  2. < Head > title = default Server Page head>
  3. < Body > Default Server Page body>
  4. html>

Get Apache 2 ready for PHP

From now on, you need to install more manually, not simply clicking and selecting a few options. Get used to it as soon as possible, this is the Apache way. You need to edit the file to set different configuration options, and if you do it incorrectly, your changes will prevent Apache from loading properly. If the setting throws an error, then the error may be logged in the Apache 2 error log (default is C:installdirapache2logserror.log). But there are a handful of records that can be recorded like this, and most errors are only recorded in the Windows event log (Start | Settings | Control Panel | Management Tools | Event Viewer).

Unfortunately, the Windows event log is not a convenient tool when you are debugging Setup settings. A better practice is to test the Apache server load in a command-line window so that you can immediately see the error report. So, after completing the configuration changes I'm about to discuss, open a command-line window and switch to Apache's binary directory (C:installdirapache2bin), where Apache is launched. The Apache configuration file is c:apacheapache2confhttpd.conf and can be edited by any text editor. Locate the DirectoryIndex, and navigate to the following line:

 
  
  

To allow Apache to process PHP pages, remove the comment character (#) and change to:

 
  
  

Also allow the. htaccess file to be used in any directory, so look for the allowoverride in the configuration file and change the setting from none to all. After you save your changes, you can continue to open the file in a text editor, because you will need to edit the file again when you install PHP later.


http://www.bkjia.com/PHPjc/446505.html www.bkjia.com true http://www.bkjia.com/PHPjc/446505.html techarticle we all know that Apache 2 and PHP are popular scenarios for creating interactive Web sites and are inexpensive. We are here on Apache 2 PHP5 installation and a detailed introduction to the little tricks in PHP ...

  • 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.