search
HomeBackend DevelopmentPHP TutorialMainstream Apache 2 PHP5 installation and use introduction_PHP tutorial
Mainstream Apache 2 PHP5 installation and use introduction_PHP tutorialJul 15, 2016 pm 01:27 PM
apachephpphp5mainstreaminteractiveintroduceusecreateandInstallusyesKnownet

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>

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>

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>

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
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
图文详解apache2.4+php8.0的安装配置方法图文详解apache2.4+php8.0的安装配置方法Dec 06, 2022 pm 04:53 PM

本文给大家介绍如何安装apache2.4,以及如何配置php8.0,文中附有图文详细步骤,下面就带大家一起看看怎么安装配置apache2.4+php8.0吧~

Linux apache怎么限制并发连接和下载速度Linux apache怎么限制并发连接和下载速度May 12, 2023 am 10:49 AM

mod_limitipconn,这个是apache的一个非官方模块,根据同一个来源ip进行并发连接控制,bw_mod,它可以根据来源ip进行带宽限制,它们都是apache的第三方模块。1.下载:wgetwget2.安装#tar-zxvfmod_limitipconn-0.22.tar.gz#cdmod_limitipconn-0.22#vimakefile修改:apxs=“/usr/local/apache2/bin/apxs”#这里是自己apache的apxs路径,加载模块或者#/usr/lo

apache版本怎么查看?apache版本怎么查看?Jun 14, 2019 pm 02:40 PM

查看​apache版本的步骤:1、进入cmd命令窗口;2、使用cd命令切换到Apache的bin目录下,语法“cd bin目录路径”;3、执行“httpd -v”命令来查询版本信息,在输出结果中即可查看apache版本号。

超细!Ubuntu20.04安装Apache+PHP8环境超细!Ubuntu20.04安装Apache+PHP8环境Mar 21, 2023 pm 03:26 PM

本篇文章给大家带来了关于PHP的相关知识,其中主要跟大家分享在Ubuntu20.04 LTS环境下安装Apache的全过程,并且针对其中可能出现的一些坑也会提供解决方案,感兴趣的朋友下面一起来看一下吧,希望对大家有帮助。

nginx,tomcat,apache的区别是什么nginx,tomcat,apache的区别是什么May 15, 2023 pm 01:40 PM

1.Nginx和tomcat的区别nginx常用做静态内容服务和代理服务器,直接外来请求转发给后面的应用服务器(tomcat,Django等),tomcat更多用来做一个应用容器,让javawebapp泡在里面的东西。严格意义上来讲,Apache和nginx应该叫做HTTPServer,而tomcat是一个ApplicationServer是一个Servlet/JSO应用的容器。客户端通过HTTPServer访问服务器上存储的资源(HTML文件,图片文件等),HTTPServer是中只是把服务器

php站用iis乱码而apache没事怎么解决php站用iis乱码而apache没事怎么解决Mar 23, 2023 pm 02:48 PM

​在使用 PHP 进行网站开发时,你可能会遇到字符编码问题。特别是在使用不同的 Web 服务器时,会发现 IIS 和 Apache 处理字符编码的方法不同。当你使用 IIS 时,可能会发现在使用 UTF-8 编码时出现了乱码现象;而在使用 Apache 时,一切正常,没有出现任何问题。这种情况应该怎么解决呢?

Linux下如何查看nginx、apache、mysql和php的编译参数Linux下如何查看nginx、apache、mysql和php的编译参数May 14, 2023 pm 10:22 PM

快速查看服务器软件的编译参数:1、nginx编译参数:your_nginx_dir/sbin/nginx-v2、apache编译参数:catyour_apache_dir/build/config.nice3、php编译参数:your_php_dir/bin/php-i|grepconfigure4、mysql编译参数:catyour_mysql_dir/bin/mysqlbug|grepconfigure以下是完整的实操例子:查看获取nginx的编译参数:[root@www~]#/usr/lo

【总结】apache调用不起来php5.6的原因和解决方法【总结】apache调用不起来php5.6的原因和解决方法Mar 28, 2023 pm 03:00 PM

PHP5.6和Apache是Web开发中最常用的工具之一。然而,有时候,当我们尝试调用PHP5.6时,会遇到一些问题,例如无法调用PHP文件或页面等等。在本文中,我将探讨为什么您可能无法调用PHP5.6以及如何解决这个问题。

See all articles

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

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

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),