Home Backend Development PHP Tutorial Mainstream Apache 2 PHP5 installation and use introduction_PHP tutorial

Mainstream Apache 2 PHP5 installation and use introduction_PHP tutorial

Jul 15, 2016 pm 01:27 PM
apache php php5 mainstream interactive introduce use create and Install us yes Know net

We all know that Apache 2 and PHP are popular options for creating interactive websites at very low cost. Here we will introduce some tips in detail on the installation of Apache 2 PHP5. In the Windows installation section of the PHP 4.3 manual, there is no explanation on how to use Apache 2 PHP5 together, and the section about the installation of Apache 2 PHP5 is missing a lot of information you need. . Other installation guides posted online also contain many errors, forcing some installers to resort to trial and error. For example, some people even replace PHP DLLs with DLLs from other PHP versions. OK, in order to save your precious time, we have prepared this most authoritative guide article to help you eliminate all worries.

Use the correct version of Windows

First a word about compatibility: Apache 2 will not run on Windows 95; it will barely run on Windows 98, but not Used as a service. Starting from version 4.3, PHP no longer supports Windows 95. Therefore, your Windows operating system must be Windows NT, 2000 or XP.

Apache 2: Source code or binary?

If you have Visual C++ 5.0 or higher, or have Microsoft Visual Studio installed, then although you can use the source code Generate Apache, but please never do this. In the Visual Studio IDE, the build process under Windows is very complicated. Even compiling from the command line is definitely not an easy task. So, unless you like creating makefiles, it's best to get a copy of the Windows Installer binary distribution, which is an .msi file. Only when you know enough about Apache and know what customization operations you want to perform can you consider generating (compiling) Apache yourself.

If you have installed and running an old version of Apache, you must first stop it and uninstall it before you can 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 plan to install Apache to a remote computer, then set localhost), enter your email address in the Administrator's Email Address field, and keep port 80/Service The selected state of the option radio button. If you choose Typical installation in the next dialog box, you can quickly get a working server environment.

Apache 2 PHP5 installation tips

It is recommended to change the default installation directory from C:Program FilesApache Group to C:Apache or other names that comply with the 8.3 file name format. This way, you don't have to add quotes to the Apache installation path every time you enter it in the future.

Wait a moment and the installation wizard will tell you that Apache 2 is successfully installed. The only thing left to do next is to test. Open a browser and visit localhost. You should see the default Apache 2 home page.

You can then delete all sample files in the main web server directory, which are located by default in C:InstallDirectoryApacheApache2htdocs. If there is a ready-made homepage Index.html, please copy it here; in addition, you can also create a blank homepage immediately. For uninitialized HTML, the following code will do:

<ol class="dp-xml">
<li class="alt"><span><strong><font color="#006699"><span class="tag"><span class="tag-name">html</span><span class="tag">></span></span></font></strong><span> </span></span></li>
<li class=""><span> </span></li>
<li class="alt">
<span></span><strong><font color="#006699"><span class="tag"><span class="tag-name">head</span><span class="tag">></span></span></font></strong><span class="attribute"><font color="#ff0000">title</font></span><span>=</span><span class="attribute-value"><font color="#0000ff">default</font></span><span> server page</span><strong><font color="#006699"><span class="tag"></span><span class="tag-name">head</span><span class="tag">></span></font></strong><span> </span>
</li>
<li class=""><span> </span></li>
<li class="alt">
<span></span><strong><font color="#006699"><span class="tag"><span class="tag-name">body</span><span class="tag">></span></span></font></strong><span>Default server page</span><strong><font color="#006699"><span class="tag"></span><span class="tag-name">body</span><span class="tag">></span></font></strong><span> </span>
</li>
<li class=""><span> </span></li>
<li class="alt">
<span></span><strong><font color="#006699"><span class="tag"></span><span class="tag-name">html</span><span class="tag">></span></font></strong><span> </span>
</li>
</ol>
Copy after login

Getting Apache 2 ready for PHP

From now on, you need more Installation is done manually rather than 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; if not done correctly, the changes you make will prevent Apache from loading correctly. If the setting causes an error, the error may be logged to the Apache 2 error log (default is C:InstallDirApache2LogsError.log). But there are only a few that can be logged like this, and most errors will only be logged to the Windows event log (Start | Settings | Control Panel | Administrative Tools | Event Viewer).

Sadly, the Windows Event Log is not a handy tool when debugging your installation setup. A better approach is to test the loading of the Apache server in a command line window so you can see error reports immediately. So, after completing the configuration changes I'm about to discuss, open a command line window, switch to Apache's binary directory (C:InstallDirApache2bin), and start Apache there. The Apache configuration file is C:ApacheApache2ConfHttpd.conf and can be edited with any text editor. Find the DirectoryIndex and locate the following line:
<ol class="dp-xml"><li class="alt"><span><span>DirectoryIndex index.html index.html.var # index.php </span></span></li></ol>
Copy after login

In order to allow Apache to process PHP pages, remove the comment character (#) and become:

<ol class="dp-xml"><li class="alt"><span><span>DirectoryIndex index.html index.html.var index.php </span></span></li></ol>
Copy after login

Also allow any The directory uses .htaccess files, so look for AllowOverride in the configuration file and change this setting from None to All. After saving 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.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446505.htmlTechArticleWe all know that Apache 2 and PHP are popular solutions for creating interactive websites at very low cost. Here we will introduce some tips in detail on Apache 2 PHP5 installation. In PHP...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

CakePHP Useful Resources CakePHP Useful Resources Sep 10, 2024 pm 05:27 PM

The following resources contain additional information on CakePHP. Please use them to get more in-depth knowledge on this.

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

See all articles