Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 哪位大侠知道我的Apache2.4.3为什么启动报错Cannot load php5apache2_4.dll into server呢

哪位大侠知道我的Apache2.4.3为什么启动报错Cannot load php5apache2_4.dll into server呢

Jun 23, 2016 pm 02:20 PM

我用的软件分别是:
httpd-2.4.3-win32.zip
php-5.4.9-Win32-VC9-x86.zip
php5apache2_4.dll-php-5.4-win32.zip中的PHP 5.4.9文件夹内的php5apache2_4.dll
配置参考http://deloz.net/1000000568.html这篇文章
还装了Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)补丁
问题是:启动Apache时,报Cannot load php5apache2_4.dll into server错
把httpd.conf文件中的LoadModule php5_module "d:/php/ext/php5apache2_4.dll"
加上#,Apache就能启动了,但php不能运行。


回复讨论(解决方案)

d:/php/ext/php5apache2_4.dll
真实存在吗?

这个 php5apache2_4.dll-php-5.4-win32.zip 是什么意思?

d:/php/ext/php5apache2_4.dll是真实存在的,php5apache2_4.dll-php-5.4-win32.zip是因为php现在不提供VC9版本的了,针对apache的一个dll,大概是这个意思。

刚才说错了php现在不提供VC6版本的了,版主帮我想想办法啊!

你应该到这里 http://windows.php.net/download/#php-5.4

在这个栏目下
VC9 x86 Thread Safe (2012-Nov-21 21:22:38)
Zip [22.32MB] 下载这个
sha1: 84aa190dc73605c22045e8e2f2281908478076e4

我就是在那个地方下载的啊,Zip [22.32MB]下载的文件名就是php-5.4.9-Win32-VC9-x86.zip。

前面 LoadFile php5ts.dll 了么?

没有,怎么Load的,我是按照上面的描述中的那个文章配置的,也不知道那个文章是不是正确的。

###################### PHP内容 开始 #############################
#设置PHPRC变量,以提供给PH5查找配置文件PHP.ini,就无需在跑到%SystemRoot%下去找php.ini了
SetEnv PHPRC "。。。/PHP5/"
PHPINIDir "。。。/PHP5/php.ini"

#加载php5ts.dll,这无论是apache还是IIS都必须以来的链接库
LoadFile "。。。/PHP5/php5ts.dll"

#加载php5的apache模块
LoadModule php5_module "。。。/PHP5/php5apache2_4.dll"

#为了兼容添加php3和php4的类型
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4


###################### PHP内容 结束 #############################

LoadFile "d:/php/php5ts.dll"(加了这句,重启了电脑还是起不来Apache)
LoadModule php5_module "d:/php/ext/php5apache2_4.dll"
PHPIniDir "d:/php/"

我还发现了一种写法起不来Apache
LoadFile "d:/php/php5ts.dll"
#LoadModule php5_module "d:/php/ext/php5apache2_4.dll"
#PHPIniDir "d:/php/"

我记忆中只用php自己的apache dll就行了,注意是ts版本就行
查一下你的php.ini有没有错误,先把不必要的dll先注释掉,逐个开启测试
(可以在DOS窗直接运行php,会提示你ini里面那些项目过时了)
另外有些模块dll是有关联的,mb好像要放在前面

都快忘光了,我基本就保存配置文件,重装也很方便,反正都是绿色的

好像是php5.3之前的版本都可以用php自己的apache dll,这之后官网就没有了VC6版本,用php自己的就不行了。现在测试的结构是Apache中的LoadFile命令无效,dll不管放在哪个盘的文件夹,都读取不到。

php-5.4.9-Win32-VC9-x86.zip 么有提供 php5apache2_4.dll
只提供了 php5apache2_2.dll 和 php5apache2_3.dll

搜索了一下 php5apache2_4.dll
感觉你是按这个来做的 http://www.cnblogs.com/cxybjfu/archive/2012/10/09/2716880.html
使用的是非官方的 apache 和 php5apache2_4.dll
自然是后果自负

文章中的表述有不少错误,说什么 使用VC9编译的PHP的同时,必须使用VC9编译的Apache

我就是用 VC6 的 apache 2.2 加 VC9 的php5.3、php5.4

终于apache2.4起来了,下载Microsoft Visual C++ 2008 Redistributable Package (x86)这个文件,地址http://www.microsoft.com/en-us/download/details.aspx?id=29。估计我是下错成Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)这个了。谢谢大家的帮助!

……
很无语,居然是这个问题,我装系统时就全装了各个版本的VC

官方下载的PHP怎么都是压缩包?没有安装的呀?我也遇到这位仁兄的问题,PHP里只有php5apache2_4.dll,没有php5apache2_2.dll。怎么也关联不起来。

先手动运行php目录下的php.exe文件,新版本由于需要vc的支持,如果没有安装会提示msvcr110.dll找不到,安装vc即可解决
安装vc11相关组件,请到 http://www.microsoft.com/zh-CN/download/details.aspx?id=30679 下载
没有报错后再去配置http.conf文件,加载php5apache2_4.dll(这个代表的是2.4版本的appache),如果是2.2的apache去加载2.4的支持文件,就会报错Cannot load php5apache2_4.dll into server
LoadModule php5_module "d:/php/php5apache2_4.dll"
PHPIniDir "d:/php/"
我是遇到这个问题,用了2.2的apache去加载2.4的文件,升级了apache到2.4后,问题解决
http://www.apachelounge.com/download/  apache2.4 版本下载地址

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 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)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Describe the SOLID principles and how they apply to PHP development. Describe the SOLID principles and how they apply to PHP development. Apr 03, 2025 am 12:04 AM

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

How to send a POST request containing JSON data using PHP's cURL library? How to send a POST request containing JSON data using PHP's cURL library? Apr 01, 2025 pm 03:12 PM

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

Framework Security Features: Protecting against vulnerabilities. Framework Security Features: Protecting against vulnerabilities. Mar 28, 2025 pm 05:11 PM

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

How to debug CLI mode in PHPStorm? How to debug CLI mode in PHPStorm? Apr 01, 2025 pm 02:57 PM

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

See all articles