Cannot start Apache (and WordPress)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Cannot start Apache (and WordPress)

Postby mygrove » 24. April 2022 20:28

I have XAMPP installed on a separate hard drive, basically to run an offline WordPress. All has worked well in the past but now I try to start Apache and I get the following errors.

20:35:52 [main] Initializing Control Panel
20:35:52 [main] Windows Version: Home 64-bit
20:35:52 [main] XAMPP Version: 8.0.9
20:35:52 [main] Control Panel Version: 3.3.0 [ Compiled: Apr 6th 2021 ]
20:35:52 [main] Running with Administrator rights - good!
20:35:52 [main] XAMPP Installation Directory: "e:\xampp\"
20:35:52 [main] Checking for prerequisites
20:35:53 [main] All prerequisites found
20:35:53 [main] Initializing Modules
20:35:53 [main] The FileZilla module is disabled
20:35:53 [main] The Mercury module is disabled
20:35:53 [main] Starting Check-Timer
20:35:53 [main] Control Panel Ready
20:36:46 [Apache] Attempting to start Apache app...
20:36:46 [Apache] Status change detected: running
20:36:47 [Apache] Status change detected: stopped
20:36:47 [Apache] Error: Apache shutdown unexpectedly.
20:36:47 [Apache] This may be due to a blocked port, missing dependencies,
20:36:47 [Apache] improper privileges, a crash, or a shutdown by another method.
20:36:47 [Apache] Press the Logs button to view error logs and check
20:36:47 [Apache] the Windows Event Viewer for more clues
20:36:47 [Apache] If you need more help, copy and post this
20:36:47 [Apache] entire log window on the forums

What's gone wrong and how do I fix it, please?
mygrove
 
Posts: 6
Joined: 24. April 2022 20:23
XAMPP version: 3.3.0
Operating System: Windows

Re: Cannot start Apache (and WordPress)

Postby Altrea » 25. April 2022 06:14

Hi,
Please try to start apache with help of the apache_start.bat script and tell us what this responses.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11936
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Cannot start Apache (and WordPress)

Postby mygrove » 25. April 2022 08:01

Here's the response:

Code: Select all
Diese Eingabeforderung nicht waehrend des Running beenden
Bitte erst bei einem gewollten Shutdown schliessen
Please close this command only for Shutdown
Apache 2 is starting ...
httpd.exe: Syntax error on line 39 of E:/xampp/apache/conf/httpd.conf: ServerRoot must be a valid directory

Apache konnte nicht gestartet werden
Apache could not be started
Press any key to continue . . .


Thanks!
mygrove
 
Posts: 6
Joined: 24. April 2022 20:23
XAMPP version: 3.3.0
Operating System: Windows

Re: Cannot start Apache (and WordPress)

Postby Altrea » 25. April 2022 11:34

mygrove wrote:httpd.exe: Syntax error on line 39 of E:/xampp/apache/conf/httpd.conf: ServerRoot must be a valid directory

SO what is line 39 of file E:/xampp/apache/conf/httpd.conf?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11936
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Cannot start Apache (and WordPress)

Postby mygrove » 25. April 2022 12:32

I thought I had solved it myself, but not quite.

Line 39 read

Code: Select all
ServerRoot "F:/xampp/apache"


So of course the drive letter was incorrect so I changed instances of F:/ to E:/

and I found similar errors in several other conf files (i.e. F:/ needs to change to E:/) so I've fixed those. Now I'm stuck again. So I've run apache_start.bat yet again:

Code: Select all
Diese Eingabeforderung nicht waehrend des Running beenden
Bitte erst bei einem gewollten Shutdown schliessen
Please close this command only for Shutdown
Apache 2 is starting ...
AH00112: Warning: DocumentRoot [F:/xampp/htdocs] does not exist
(OS 3)The system cannot find the path specified.  : AH02291: Cannot access directory 'F:/xampp/apache/logs/' for error log of vhost defined at E:/xampp/apache/conf/extra/httpd-ssl.conf:121
AH00014: Configuration check failed

Apache konnte nicht gestartet werden
Apache could not be started
Press any key to continue . . .


I think I'm getting closer but can't work out how to fix this one.

Thanks
mygrove
 
Posts: 6
Joined: 24. April 2022 20:23
XAMPP version: 3.3.0
Operating System: Windows

Re: Cannot start Apache (and WordPress)

Postby Altrea » 25. April 2022 13:14

Did you moved the xampp folder recently from drive F. to drive E:?
Or did you install XAMPP on a movable drive like an usb pen?

To update all paths of important config files please run setup_xampp.bat once.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11936
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Cannot start Apache (and WordPress)

Postby mygrove » 25. April 2022 13:40

That's a cool command: setup_xampp.bat

Now I have Apache and MySQL running.

Now this is the silly question, I just cannot remember how to start WordPress! I can see my WP content in E:\xampp\apps\wordpress\htdocs

Where do I go from here?

Thanks
mygrove
 
Posts: 6
Joined: 24. April 2022 20:23
XAMPP version: 3.3.0
Operating System: Windows

Re: Cannot start Apache (and WordPress)

Postby Altrea » 25. April 2022 14:18

In your \xampp\apache\conf\httpd.conf at the very bottom should be placed an alias for your wordpress installation.
If i remember correct the alias should be "wordpress".
This Alias is the part that need to come after the domain name in your browsers address bar, so something like http://localhost/wordpress/
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11936
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Cannot start Apache (and WordPress)

Postby mygrove » 25. April 2022 17:00

this is what is at the end of my httpd.config file

Code: Select all
# XAMPP: We disable operating system specific optimizations for a listening
# socket by the http protocol here. IE 64 bit make problems without this.

AcceptFilter http none
AcceptFilter https none
# AJP13 Proxy
<IfModule mod_proxy.c>
<IfModule mod_proxy_ajp.c>
Include "conf/extra/httpd-ajp.conf"
</IfModule>
</IfModule>
Include "E:/xampp/apps/wordpress/conf/httpd-prefix.conf"


Can you give me a steer on this alias business?

In case it is relevant E:\xampp\apps\wordpress\conf\httpd-prefix.conf contains:

Code: Select all
Alias /wordpress/ "E:/xampp/apps/wordpress/htdocs/"
Alias /wordpress "E:/xampp/apps/wordpress/htdocs"

Include "E:/xampp/apps/wordpress/conf/httpd-app.conf"


E:/xampp/apps/wordpress/htdocs contains what I recognise as regular WordPress files. (wp-admin, wp-config, wp-includes etc.)

Thanks


Thanks
mygrove
 
Posts: 6
Joined: 24. April 2022 20:23
XAMPP version: 3.3.0
Operating System: Windows

Re: Cannot start Apache (and WordPress)

Postby Altrea » 25. April 2022 17:24

mygrove wrote:Can you give me a steer on this alias business?

Code: Select all
Alias /wordpress/ "E:/xampp/apps/wordpress/htdocs/"
Alias /wordpress "E:/xampp/apps/wordpress/htdocs"

Thats not difficult.
Apache does not serve every file on your computer. You must configure which files are allowed to get served.
Each Apache Host (or Apache virtual host) does have a setting named DocumentRoot. This is the root folder from where Apache starts to serve files.
For example if you have a host with domain localhost (http://localhost/) and the DocumentRoot is set to C:\xampp\htdocs\, a request for http://localhost/index.php would try to serve the file C:\xampp\htdocs\index.php.
Each subdirectory can be addressed similar in the URL too. So http://localhost/folder123/index.php will serve file C:\xampp\htdocs\folder123\index.php

Alias are there to access a different location on your computer as if it is a subfolder, outside of the DocumentRoot of the Host. For XAMPP Wordpress this is the folder C\xampp\apps\wordpress which is mapped to Alias wordpress, so it can be accessed by http://localhost/wordpress (even there is no subfolder wordpress in your DocumentRoot C:\xampp\htdocs\
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11936
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Cannot start Apache (and WordPress)

Postby Nobbie » 25. April 2022 19:34

mygrove wrote:Can you give me a steer on this alias business?


https://httpd.apache.org/docs/current/m ... html#alias
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Cannot start Apache (and WordPress)

Postby mygrove » 25. April 2022 19:36

Thank you. Success, I'm live and back on my WordPress!

Most appreciated.
mygrove
 
Posts: 6
Joined: 24. April 2022 20:23
XAMPP version: 3.3.0
Operating System: Windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 224 guests