search
HomeBackend DevelopmentPHP TutorialPHP5.4 + apache2.4 配置问题

我的环境是:
 
    win7  64位 

    Apache2.4.4  64位

    php5.4  线程安全版本


    php.ini的配置都已完成

    apache下的配置问题

    http.conf 里

       

    LoadModule php5_module "E:/Instools/Develop/php/php-5.4.15/php5apache2_4.dll"    AddHandler application/x-httpd-php .php    PHPIniDir "E:/Instools/Develop/php/php-5.4.15"       


现在apache 无法启动,将上面3句代码注释  就没问题,请问在win7 64位 下  apache2.4 64位的 怎么配置php


回复讨论(解决方案)

AddHandler?没用过,AddType吧

AddType  也不行

必须在系统的环境path中加入如下路径

E:/Instools/Develop/php/php-5.4.15/ext;E:/Instools/Develop/php/php-5.4.15
你试试吧 今天我刚试过的

你的代码在我的apache下运行是没有问题的,但是前提是"E:/Instools/Develop/php/php-5.4.15/php5apache2_4.dll"我有修改, 最后的模块名我用的是php5apache2_2.dll。你检查下是不是你写错了?

这里还有一个建议,尽量不要用SetHandler application/x-httpd-php .php,因为这个做法有缺陷,那就是.php.txt类文件也会被解析成php代码。(传智播客php学习的时候,php韩忠康老师有强调这点)
尽量用:

   SetHandler application/x-httpd-php

还有  不然把错误日志贴出来 看下

必须在系统的环境path中加入如下路径

E:/Instools/Develop/php/php-5.4.15/ext;E:/Instools/Develop/php/php-5.4.15
你试试吧 今天我刚试过的

试过了,还是不行,apache 启动不起来,你说的日志 是apache 的logs文件夹么?

你的代码在我的apache下运行是没有问题的,但是前提是"E:/Instools/Develop/php/php-5.4.15/php5apache2_4.dll"我有修改, 最后的模块名我用的是php5apache2_2.dll。你检查下是不是你写错了?

这里还有一个建议,尽量不要用SetHandler application/x-httpd-php .php,因为这个做法有缺陷,那就是.php.txt类文件也会被解析成php代码。(传智播客php学习的时候,php韩忠康老师有强调这点)
尽量用:

   SetHandler application/x-httpd-php


php5apache2_4.dll 没有写错,原来用apache是2.2的 这个文件没问题,但是apache我用的是apache2.4  所以文件对应是2.4的 ,改成2.2的也实验了,不行

你的 64位 的 apache 能使用 32位 的接口库 php5apache2_4.dll 吗?官网上是怎么说的?

你的 64位 的 apache 能使用 32位 的接口库 php5apache2_4.dll 吗?官网上是怎么说的?

昨天晚上 实验了 apache2.4 32位的  也不行 

php5apache2_4.dll 只在最新发行的 php 5.4.15 包中存在。之前的版本中都是没有的
由此可知是实验性的。发行才没几天,显然做测试的人并不多,如果有问题,估计也还没反映上去

如果你等不及,你就自己测试。但似乎你并不具备这个能力

php5apache2_4.dll 只在最新发行的 php 5.4.15 包中存在。之前的版本中都是没有的
由此可知是实验性的。发行才没几天,显然做测试的人并不多,如果有问题,估计也还没反映上去

如果你等不及,你就自己测试。但似乎你并不具备这个能力

在php 5.4.15 之前的 版本 5.4.x中 ,php5apache2_4.dll 是作为单独zip包下载,这个时候才是作为实验测试用的,现在php5apache2_4.dll 已经整合到最新的php 版本中,只能说明 测试已经通过,而并不是你说的,整合进最新的php版本才变成测试。

还有 我发帖子 是请教配置过的朋友给予一些帮助,你的“ 如果你等不及,你就自己测试。但似乎你并不具备这个能力”和有问题 发帖子请教的人的目的不一样,按照你的意思 只要有问题 自己测试就可以了,没必要来这里请教别人了,我在怀疑你是怎么当上版主的?

错误日志,说的是apache里面相关的windows日志

我的是这样的错误提示:
httpd.exe: Syntax error on line 525 of C:/Program Files/Apache Software Foundation/Apache2.4/conf/httpd.conf: Cannot load C:/Program Files/PHP/php5apache2_4.dll into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xb3\xcc\xd0\xf2\xa1\xa3

求解决,纠结了好久了

测试环境是:windows 2003 (x86)

同样问题,怎么解决的啊????

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
Working with Flash Session Data in LaravelWorking with Flash Session Data in LaravelMar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIscURL in PHP: How to Use the PHP cURL Extension in REST APIsMar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel TestsSimplified HTTP Response Mocking in Laravel TestsMar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon12 Best PHP Chat Scripts on CodeCanyonMar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

PHP Logging: Best Practices for PHP Log AnalysisPHP Logging: Best Practices for PHP Log AnalysisMar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

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

Customizing/Extending Frameworks: How to add custom functionality.Customizing/Extending Frameworks: How to add custom functionality.Mar 28, 2025 pm 05:12 PM

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

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.

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)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

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.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment