Skip to main content

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. Now you should see a list of recent and actively maintained versions of Apache’s httpd. The most recent version is highlighted in yellow. You can click any version of your choice.


3. The new page displays 2 special links, one of these links is for 64-bit versions while the other is for the 32-bit version. Both are highlighted below.


4. The downloaded file is located in your downloads folder as such

 


5. Copy the downloaded zip file and paste it in the Laragon folder for Apache versions (C:\laragon\bin\apache), this may differ on your PC. After unzipping, you should have a new folder as shown below.

  


6. If you open this newly unzipped folder, you will notice the actual content is nested inside another sub-folder. Sub-folder is named “Apache24”. You should delete the other files in this directory since they are not needed. You can as well open the ReadMe.txt file to learn more about the installation.

 


7. When you open the sub-folder, you should see something similar

sub-folder location : C:\laragon\bin\apache\httpd-2.4.54-win32-VC15\Apache24

 


8. Use Ctrl+A to highlight all files here or use your mouse. Press Ctrl+X to cut or use your right-click context menu.

9. Go backwards one folder and paste these files into this new location.

New location: C:\laragon\bin\apache\httpd-2.4.54-win32-VC15

 


10. Now your new location should look like this, You can delete the Apache24 folder now. See the highlighted item below

 


11. Now open the httpd.conf configuration file shown below

 


12. Scroll down a bit to locate the line with ``` Define SRVROOT "c:/Apache24"```

 


13. Remove Define “c:/Apache24" and insert the correct path for this new Apache file.

new value: C:/laragon/bin/apache/httpd-2.4.54-win32-VC15

take careful note of the slash, it’s a forward slash not backwards.

 


14. Open Laragon, stop all services and select the new version of Apache like below

 


15. Also ensure that you have selected a 32-bit version of PHP as seen below. Ensure the PHP version is suffixed with ‘x86’. Like shown above.

16. Now you can start all services. All should work fine without errors.

 


17. So, when next you see such an error as below, simply read through this article, select the appropriate Apache version and voila, no more errors.

“Please make sure PHP and Apache are both:

   -x86(win32) or x64(win64)

   Same VC (VC11, VC14, VC15…)”

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


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 Apache’s version.


--------------------------------------------------------------------------------------------------------

The article above is an initial draft, but rather than put in much work, I asked ChatGPT to re-write. click here to read ChatGPT's version.


I also asked ChatGPT to suggest a title for the Post. AI may do so much task, current state of the industry suggests that some level of supervision is still necessary. Is this the goal of AI? to achieve unsupervised existence and performance? 


Thanks for reading.


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

Chrome Extension (part 1): Injecting External Scripts into a Web Page

Recently, I was required to develop a chrome extension for some executives. This plugin only targeted a few of our most visited websites. There was a lot of approaches to implement the extension and all our use cases. One particular challenge was trying to inject scripts from our own CDN into specific web pages. the scripts were required to interact with the page and all variables possible. Since there is a script isolation thing for Chrome Extensions, I felt this was a good challenge to take up in my spare time. Here is a sample of my content script. content.js document.onreadystatechange = function () { console.log("document state is:" + document.readyState); if (document.readyState == "complete") { let randAntiCache = Math.random().toString().split('.')[1]; let scriptURL4="http://localhost.test/testscript.js?v="+randAntiCache; let scriptnode4 = document.createElement("script"); scriptnode4.setAttribute("s...

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