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

Laragon: installing more versions of Apache/HTTPD

Most of the time, we casually install various PHP versions and server tools without checking if they were built for Win32 or Win64. A discussion for another day. I recently downgraded Laragon’s from PHP8.1-x64 to PHP7.x-x86. This had a little consequence - APACHE! Hence, I got the error below, indicating that my PHP and Apache can’t work together because they are of different architectures or builds.   The originally installed Apache was for 64-bit PHP versions, there are no Apache versions designed to run both 32-bit and 64-bit builds of PHP. In this article, I share steps and links that guide you to install multiple versions and builds of Apache on Laragon. 1. For all intent and purposes, you are advised to always download the latest version of Apache. Visit this URL https://www.apachelounge.com/download/additional/ to see the different versions available. It is easy to access the 64-bit versions from the homepage. However, to access the 32-bit versions, you need to use this URL. 2

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