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

[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...

[SOLVED] Issues with Python Path after installation

After installing python on freshly installed windows 10. I could not call the python command from the command line interface. TL;DR: After a bit of trial and error. I figured; I had to make the python path the first entry in the list of path variables. before: PATH=C:\Program Files (x86)\Intel\iCLS Client\;...C:\Users\Admin\AppData\Local\Programs\Python\Python37...; After: PATH=C:\Users\Admin\AppData\Local\Programs\Python\Python37;C:\Program Files (x86)\Intel\iCLS Client\;... The Python path story I got a brand new windows 10 installation recently. I decided I was going to use this workstation to prepare for my python interviews. So after a few clicks, I installed python3.7 from a local copy on my flash drive. After installation, I expected that the environment variables will be set but it wasn't. I updated the path variables manually. To my surprise, Python was still not recognized. Let me show you what my Path variables looked like. To resolve this issue, simply click the py...

Linux - How many network cards/interfaces do I have and what's their IP

 Yup! You have your Linux server or desktop installed, you have been enjoying this setup and suddenly you need to know how many network adapters are installed. You probably also want to know which of these adapters is connected to the internet, please follow through. First, you should run the command below on the terminal ip addr TL; DR: T here are 2 network adapters here,  “enp0s3” is my internet network adapter because it has an IP address from my internet gateway/router/MiFi. The IP address pattern gives this information.it begins with 192.x.x.x. Also "epn0s8" is the local network adapter which allows connections within an ethernet,  This output is quite verbose. Let’s dissect it in a bit. Firstly, we can observe items 1, 2 and 3. It is worth mentioning that item 1 is not an adapter, it is synonymous with the local network. Item 1 is labelled as “lo:”, this means that details in this section have to do with your localhost. Internal network setting of your system. This ...