Skip to main content

Resolving Incompatible Builds of PHP and Apache in Laragon: Add multiple versions of Apache

 As developers, it's often the case that different versions of PHP and server tools are installed quickly without taking into account the architecture for which they were built. In this article, we will focus on solving a specific error that arises when running incompatible builds of PHP and Apache.


Recently, I encountered an issue when downgrading my Laragon setup from PHP 8.1 (x64) to PHP 7.x (x86). This caused compatibility problems with Apache, and I received an error message indicating that my PHP and Apache builds were not compatible, as the Apache installed was built for x64 versions of PHP.

In this article, I'll provide a step-by-step guide on how to install multiple versions of Apache on Laragon. By following these steps, you can resolve any similar issues that you may encounter.


Step 1: Download the Latest Version of Apache

Visit https://www.apachelounge.com/download/additional/ to download the latest version of Apache. The homepage provides quick access to 64-bit versions, but to access the 32-bit versions, use this URL.


Step 2: Choose Your Apache Version

From the list of recent and actively maintained Apache versions, choose the version you want to install. The most recent version is highlighted in yellow for easy reference.



Step 3: Select Your Build

On the next page, you'll find links for both the Win64 version and the Win32 version. The Win32 version is compatible with x86, while the Win64 is compatible with x64.



Step 4: Download and Locate the Zip File

The downloaded file will be in your downloads folder. Copy and paste it into the Laragon folder for Apache versions (C:\laragon\bin\apache). After unzipping, a new folder should be created.



Step 5: Delete Unnecessary Files

Open the unzipped folder and delete all unnecessary files. The actual content is inside a sub-folder named "Apache24".



Step 6: Copy Files to the Correct Location

Cut all files from the sub-folder and paste them into a new location, one folder back (C:\laragon\bin\apache\httpd-2.4.54-win32-VC15), then delete the Apache24 folder (highlighted in red).



Step 7: Update the Configuration File

Open the httpd.conf configuration file and find the line with "Define SRVROOT "c:/Apache24". Replace "c:/Apache24" with the correct path for the new Apache folder (C:/laragon/bin/apache/httpd-2.4.54-win32-VC15).

before

after



Step 8: Select the Correct Apache and PHP Versions

In Laragon, stop all services and select the new Apache version and a 32-bit PHP version suffixed with "x86".



Step 9: Start All Services

Start all services, and you should no longer encounter any errors.



In conclusion, when you encounter an error indicating that your PHP and Apache builds are not compatible, simply follow these steps to select the appropriate Apache version.

Although in this article, we downgraded Apache to match the PHP version, alternatively, we could also upgrade or downgrade PHP to match with Apache’s version.


Extra

This article you have just read was proofread/edited by Chat-GPT. First, I wrote this article on a notepad, and then I asked Chat-GPT to "re-write as a professional tech blogger". Click the link to see the original article. I also asked it to give an appropriate title for the post.

Comments

Popular Articles

Issue with installing python-axolotl or python-axolotl-curve25519 on Windows

It is peeve amazing how many hours get burnt while trying to resolve simple package dependency issues. I may be too dumb to proffer a lasting one-fits-all solution to all dependency issues, but I got this issue fixed in my own case. Problem Description: The python-axolotl library requires certain dependencies that are not properly managed when installing libraries via a command line's requirement.txt file. I got real help by reading through this link below, but this page might be more helpful when it comes to detailed instructions. Actual instructions: https://github.com/tgalal/python-axolotl Typical errors might look like the following: 1. In this case, missing library(s). Libraries needed for compiling some python resources. Unfortunately, http://aka.ms/vcpython27  has been decommissioned because Python2x is EOL. You can still get the VcPython27 from an archive at https://web.archive.org/web/20210106040222/download.microsoft.com/download/7/9/6/796EF2E4-801B-4F...

[SOLVED] Linux - Issues installing Docker on Ubuntu - libseccomp2 version 2.3.1 installed but 2.4 required

This article has been improved for a better understanding - goto  https://splashcoder.blogspot.com/2023/07/installing-docker-on-ubuntu-1804-solved.html There is a possibility that you are trying to install docker. There is a very comprehensive guide at https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository. The linked guide serves as a reference for this article. We try to address the common errors in this article. Just so you won’t have to scour the entire answers on StackOverflow. Step 1: The first thing is to run our famous "apt update" command. So run the command below. sudo apt-get update You may observe that there are some errors. And YES! we are using a fairly old Ubuntu 18.04 Bionic Beaver Release. It seems perfect for this as most people have issues installing docker anyways. To resolve this, you may refer to  Configure DNS server IP to resolve errors with apt-get update Step 2: Following the Docker article, we should run the commands below. sudo...

VS CODE: Unable to install extensions on Ubuntu/Linux

Hey, its one of those days, i just wished i could code away the night. i decided that tonight, it was going to be VS Code all through. I closed Sublime text. It was not long before I started missing the php code linting and ever intelligent code completions that were built into sublime text. I checked the suggestions on the Extensions Tab of VS Code. and there it was! Felix Becker's "PHP IntelliSense" package. To my cute surprise, Upon clicking, the extension's description and Installation "Read Me" could not display correctly, 'twas as good as blank. All i could see was this: I thought, this is something light, so i started searching but then it was not better explained except for the GitHub issue which I found to be useful, Link is at the bottom of this page.  I hate to discover it was a DNS issue. How to detect the Issue Simply visit the URL below, if you are able to view the image on the page, then you are not affected by this issue. DNS Test URL: ht...