XAMPP Can't Start Apache After Upgrading to PHP7.1.17 "Attempting to start Apache service..." - apache

I have XAMPP installed on Windows 7 virtual machine. My old PHP version was 7.0.9 with Apache 2.4
I needed to upgrade the PHP version to 7.1.x and I set out reading about how to best to this. In end, I settled with the simple plan:
Stop Apache service
Downloaded new PHP version from official php website. For PHP 7 the 7.1.17 version was listed. I downloaded the thread safe version, as my Apache has thread safety enabled.
I extracted the contents of the downloaded archive to a folder.
I copied and replaced all files in the appropriate folders from C:/Server/php with the new php version files from the extracted archive.
I attempted to start Apache from the XAMPP control panel and the server will not start.
The message "Attempting to start Apache service..." just hangs and nothing happens.
The last entry in the error.log file in C:\Server\apache\logs shows the event when the server was stopped and that's it.
When I check the php version from CLI with the command php -v, the console returns installed php version 7.1.17
I tried different suggestions I read from similar questions, like changing ServerName localhost:80 to ServerName localhost:8080 and copying php7apache2.dll to apache/bin ( as suggested here: Upgrading PHP in XAMPP for Windows? ), alas the issue is not fixed and Apache does not start.
Of course, I also restarted the virtual machine, all the same.
At this point, I'm dumbfounded. Don't know what to do.
I need to get Apache running with php 7.1, as it is required by Magento 2.2.4. I do not want to reinstall XAMPP, as this will be a lenghty process with a lot of risk for more things to go wrong.
Any help is much appreciated!

Alright, so after checking Windows Logs > Application in Event Viewer I saw the error ".. the Apache service named is not a valid win32 application". I downloaded the x86 version of PHP from official website PHP for Windows
Then copied and replaced files as described above, and Apache started successfully.
To see if your Apache version is x64 or x86 open command prompt and cd to your Apache bin directory, in my case C:/Server/apache/bin , then run:
file httpd

Related

XAMPP tomcat service is not starting with error as "Tomcat Started/Stopped with errors, return code: 1"

I have installed XAMPP 7.2.10 on my Win 10 and other services like Apache and MySQL are working fine.
But the Tomcat service is not starting and is throwing an error as:
"Tomcat Started/Stopped with errors, return code: 1,
Make sure you have Java JDK or JRE installed and the required ports are free,
Check the "/xampp/tomcat/logs" folder for more information"
XAMPP Tomcat error image
I have installed Java JDK in "C:\Program Files\Java" and have set the environment variables path.
I have set the "JAVA_HOME" variable path as "C:\Program Files\Java\jdk-10.0.2"
Also, no other program is using the required ports.
When I run the "catalina_start.bat", I get error as:
"ERROR: The system was unable to find the specified registry key or value.
. [XAMPP]: Cannot find current JDK installation!
. [XAMPP]: Cannot set JAVA_HOME. Aborting ..."
What mistakes have I made here?
I had the same problem (XAMPP 7.3.0 / Windows Server 2016 / Java 11). I first checked the environment variables, the java installation - all seemed to be fine.
Sadly the XAMPP error message is not very meaningful, so i looked inside of tomcat installation. To my surprise XAMPP 7.3.0 uses a very old version of Apache Tomcat (7.0.56 from 2014!), that don’t work well with Java 9+. The reason is Tomcat 7.0.56 uses the "-Djava.endorsed.dirs" option, that is no longer supported in Java 9+. Up-to-date Tomcat versions have no problem with java 9+. To solve this you can just stay with Java 8 (if possible for you) or try to fix this on your own by modify Tomcat start-up: Go to your \xampp\tomcat\ folder and see this fix in Tomcat 7.0.73 doesn't work with java 9.
But i would recommend you to install a up-to-date version of tomcat and don’t use the XAMPP one (what i finally did) - at least until XAMPP updates there tomcat version .

How to get mod_jk.so/mod_jk.dll file for windows?

I am configuring httpd in windows server for load balancing. One of the step in configuration is to download tomcat connector for windows and put mod_jk.so file into modules folder.
I downloaded latest connector of windows from https://tomcat.apache.org/download-connectors.cgi
But after extracting, I could not find this file. I found some steps to build it on some sites, but those steps are of linux environments.
How to get mod_jk.so for windows environment ?
If you want mod_jk for Windows/httpd, then you should get it from the same place you got your binary distribution of httpd.
You probably got it from ApacheLounge, which BTW is not directly-affiliated with the Apache Software Foundation, but has been providing Windows binaries for quite some time and seems to be reputable. YMMV.

installing and running Redis and Memcached on Xampp on Windows

I have a Win 10 (Creator edition) PC, running Xampp with Apache and MySQL.
I need to install and run Redis and Memcached (not memcache) on it.
I've looked it up and found out that all I need to do is to enable the existing extensions located in the /xampp/php/ext folder for these components.
So:
I don't have a DLL file for memcached (again, not memcache) there.
(everything I found for this matter is talking about enabling the existing extension, but again - I need memcached and not memcache)
I do have the php_redis.dll file under the /xampp/php/ext folder and I enable it in the php.ini file, but when I run "phpinfo()" in my code, I don't see "redis" in the list of running components there.
What am I missing here and how can I get these two "clowns" to run on my Win-based Xampp system??

How to upgrade Apache on a Windows server?

I have just upgraded our webserver from PHP 5.3.6 to 5.3.10, and I now want to upgrade Apache as well from 2.2.17 to 2.2.22 (on a Windows Server). How do I go about this in a good way (on a live webserver)? A little downtime is alright, but not too much.
Apache is installed via an MSI installer and I'm not sure how to upgrade safely with the least downtime.
Do I just download the latest installer and install that? And what about my config files? I don't think it's possible to have both instances installed 'next to each other'? Or is it?
For anyone else who searches for this, I found that uninstalling the old Apache (in my case, 2.2.22) from Add/Remove Programs and installing the new version (in my case, 2.2.24) kept all the previous settings.
We had locked down the httpd.conf file and had an application that modified/added files in the "htdocs" directory.
Upon uninstalling and re-installing, all of these files were left unchanged and the new version of Apache Server is reflected.
Download a latest version of apache installer.
Make the necessary config changes.
Run it on a different port, other than your live server.
If things work well, correct the port number, and replace.
It will really take a little down-time.
I did it today on windows server 2012R2, apache was installed from "source" (installer was not used-updated to 2.4.55):
1.Stop apache service
2.Rename apache directory (from C:\Apache24 to C:\Apache24-old)
3.Extract Apache24 folder from zip archive downloaded from apache web site to original location (C:\)
4.Copy conf folder from previous installation to the extracted folder (Copy C:\Apache24-old\conf to C:\Apache24\conf-overwrite)
5.(Optional), if you have any certs copy it from C:\Apache24-old\ to C:\Apache24
6.Start apache service,no issues faced

Uninstalling user install of Apache on Mac Mini

I got a MacMini at work for development, and was asked to follow this article to install SVN on it: http://developer.apple.com/tools/subversionxcode.html The article assumes that only Apache 1.3 was installed and asks the reader to install Apache 2. I've since learned that the MacMini has Apache 2 already installed. So basically I've installed two versions of Apache 2. The preinstalled one has access to PHP, so I wanted to remove my version, but I'm unsure of how.
My version has httpd.conf stored at:
/usr/local/apache2/conf/httpd.conf
And the preinstalled version has it stored at:
/etc/apache2/httpd.conf, which I believe is an alias for /private/etc/apache2/httpd.conf
Thanks for your help
Delete the Apache2 folder from the location you specified, /Library/StartupItems/Apache2, and /Library/Receipts/Apache2.pkg according to:
http://www.glinder.com/bulkfiles/UNIXInfo/Apache2_Install_Guide.pdf