search
Homephp教程php手册windows下php apache 安装的几个问题

时隔一年,再次安装apache+php,装完对php又有了新的认识。

去年安装的时候写过笔记:http://blog.csdn.net/monkey7777/article/details/9261325。

关于详细配置课参看上面笔记。

现在写下安装过程中可能出现出现的几个问题:


1.启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name

这个问题我的理解是:端口问题。(端口占用,端口冲突类似问题)

一种办法是在apache的httpd.conf文件中查找“Listen”修改其端口值。

另一种办法是查找当前占用端口的进程并杀死该进程。

查找端口使用情况:

netstat -anofindstr "8080"
查看使用该端口的进程:(“x”为进程号)
tasklistfindstr "x"

结束某个进程:(“x”为进程号)

tskill "x"
鉴于我的tomcat用的端口8088,iis用的8080,于是我把Listen值改成了8090解决了问题。


如果用上面两种方法都没有解决(应该是DNS配置的问题),可以在httpd.conf中添加一句话(添加“ServerName localhost:8090”,位置如下):

#ServerName www.example.com:80
ServerName localhost:80


2.启动Apache时提示错误“Cannot load php5apache2_4.dll into server”

我下载的是最新版本的php(php-5.5.15-Win32-VC11-x64)。

在httpd.conf中有这么一句:(报错的时候显示这一行错误)

LoadModule php5_module "c:\php\php5apache2_4.dll"

看到这个问题第一个想法是用php5apache2_2.dll替换php5apache2_4.dll,实践证明失败了。

网上搜了一下,原因可以理解为:版本问题。

细心点会发现php名字上会有VC9,VC11的标识。代表着该php应该运行在什么样的VC编译环境下。(毕竟这个东西实用C++写的嘛...)

我的理解是带有VC9的应该运行在装有VC2008运行库下,VC11的应该在装有VC2012运行库下。可是我安装了2012的运行库之后发现还是不能正确运行。用了亮神给的php-5.3.6-Win32-VC9-x64(里面的是php5apache2_2.dll),配置好后运行ok。

http://windows.php.net/官网上有如是说:

VC9 and VC11
More recent versions of PHP are built with VC9 or VC11 (Visual Studio 2008 and 2012 compiler respectively) and include improvements in performance and stability.

The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed.

The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed.
意思就是VC9和VC11各自需要特定的编译环境。VC9 --> VC2008,VC11 --> VC2012。


网上看到这样一种说法。“由于apache版本的不同,对应的“php5apache2.dll”也不同” 。意思是apache和php版本有相互配套的关系。

即:

Apache2.2 对应 php5apache2_2.dll
Apache2.1 对应 php5apache2.dll
Apache1 对应 php5apache.dll
但我觉得应该没有对应关系,毕竟官网上没说嘛。

可是我装了VC2012运行库后VC11版本的php还不好用,我只能怀疑我VC2012运行库没装好或者真的存在某种对应关系了。

如果环境没问题,这个对应关系不妨一试。



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

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)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor