JIYIK CN >

Current Location:Home > Learning > OPERATING SYSTEM >

Apache2.4+PHP5.6 environment configuration under Windows7

Author:JIYIK Last Updated:2025/04/07 Views:

I upgraded my Windows 7 32-bit operating system to a 64-bit operating system, and the previous PHP environment also needed to be reconfigured. Previously, I used apache2.2 and php5.3. Since I upgraded the operating system, I also upgraded the PHP environment.

The PHP environment currently used is Apache 2.4 and PHP 5.6.

For the installation of Apache2.4, you can refer to the article "Apache2.4 Installation under Windows7" . The downloaded PHP5.6 is a green version, so there is no need to install it. Just copy it to the D:/wamp directory as php56 (it should be noted here that when we download php, we have to download the Thread Safe version).

Next, we will mainly talk about configuring Apache to support PHP. It is actually very simple. Open the Apache configuration file httpd.conf and add the following three lines to it:

LoadModule php5_module "D:/wamp/php56/php5apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "D:/wamp/php56/"

And find

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

Change to

<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

After saving and exiting, start the Apache service. Normally, it should be able to start smoothly. However, there are usually some problems here. See the following content

D:\wamp\Apache24\bin>httpd -k start //Start the apache service
httpd: Syntax error on line 181 of D:/wamp/Apache24/conf/httpd.conf: Cannot load
 D:/wamp/php56/php5apache2_4.dll into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\x
b6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3
 

We see that the startup fails. The problem is that php5apache2_4.dll cannot be loaded into the service. There are many reasons for this problem. However, a common one is the version mismatch. And most of the cases are caused by this version problem.

When I was configuring the PHP environment, I checked the versions of my Apache and PHP when this problem occurred. The full name of the software I downloaded for Apache is: httpd-2.4.23-x64-vc14-r3; the full name of the PHP software is: php-5.6.27-Win32-VC11-x64. As for the versions, the two software versions are compatible, so where is the problem? In fact, if we observe carefully, we will find that the version of the Visual C++ component used in the Apache software is different from that in PHP. Apache is VC14, while PHP is VC11. The different component versions cause the dll class library to not load correctly.

Actually, this is also my guess. Because I have never encountered a similar situation before. However, when I downloaded the Apache software, I found that it also has a VC11 version, so with this glimmer of hope, I re-downloaded the Apache software as httpd-2.4.23-x64-vc11-r3. Then I followed the steps described above to configure and start the Apache service, and a miracle happened, the service can be started normally.

Create a new phpinfo.php file under D:/wamp/Apache24/htdocs and write the following code

<?php
Phpinfo()

Then enter http://localhost/phpinfo.php in your browser

The above content appears, indicating that our environment has been successfully configured.

What I want to say here is that in the process of configuring the PHP environment, the steps are actually similar. What we need to pay attention to is the versions of the software and the versions of the component libraries they rely on, which must be compatible. Of course, when problems arise, we must first ensure that all the component libraries that should be installed are installed. The next step is to check the version compatibility.

For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.

Article URL:

Related Articles

Installing PostgreSQL client tools on Windows

Publish Date:2025/04/09 Views:135 Category:PostgreSQL

When we develop applications, we end up hosting them with the desired cloud providers under specific monthly or annual subscriptions. Depending on your plan, these subscriptions provide us with different services like data stored in databas

Issues to note when installing Apache on Linux

Publish Date:2025/04/08 Views:78 Category:OPERATING SYSTEM

As the most commonly used web server, Apache can be used in most computer operating systems. As a free and open source Unix-like operating system, Linux and Apache are a golden pair. This article will introduce the installation and use of A

Apache2.4 installation and precautions under Windows7

Publish Date:2025/04/08 Views:125 Category:OPERATING SYSTEM

To install apache2.4 in Windows 7, we first need to download the apache2.4 installation program. Here we download the software from the apache official website http://httpd.apache.org/download.cgi . First, let's see how to download apache2.

Detailed introduction to installing Gradle on Windows

Publish Date:2025/04/07 Views:138 Category:OPERATING SYSTEM

Gradle is a Java-based tool, so it requires Java 8 or higher to be running on your machine. Before installing Gradle, make sure you have Java SDK 8 or higher installed. It runs on all major operating systems. We don't need to install groovy

Configuring Apache Web Server on Ubuntu and Debian

Publish Date:2025/04/05 Views:176 Category:OPERATING SYSTEM

This article shows you how to install Apache web server on Ubuntu and Debian, set it up, and access the access logs. Apache Web Server in Ubuntu and Debian Apache HTTP Server is a free and open source web server that is very popular. More t

Close the Git commit editor on Windows

Publish Date:2025/03/31 Views:62 Category:Git

In this article, we will discuss how to exit the Git commit editor. This can be a little tricky, especially if you are new to Git bash . Let's see how to exit the editor on Windows. Close the Git commit editor on Windows We will look at a t

Scan to Read All Tech Tutorials

Social Media
  • https://www.github.com/onmpw
  • qq:1244347461

Recommended

Tags

Scan the Code
Easier Access Tutorial