ERROR Apache Service not Started -1

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

ERROR Apache Service not Started -1

Postby kevinpclarke » 07. September 2011 19:25

Dear Forum,

I'm new to Xampp (current version and have tried to install it on my windows 7 twice without luck.. The installation part goes through without any error, but when starting the Apache Service within the Xampp control panel I see the error: "ERROR Apache Service not Started -1". Also if I attempt to stop the Mysql service it won't stop. I see the following: "ERROR Mysql Service not Stopped -1"

There is no Apache log being created. I also made sure Skype is not using this port and unticked the port 80 / 443 box within Skype. I do not or cannot see an IIS process running within my services either.

I did install the Xampp in C:/Xampp as suggested.

Any help with this problem would be greately appreciated

Kind regards
Kevin
kevinpclarke
 
Posts: 6
Joined: 07. September 2011 13:36

Re: ERROR Apache Service not Started -1

Postby JonB » 08. September 2011 00:11

First question - did you use the installer or the Zip file?

IF you used the installer -

BE SURE TO DO ALL THESE THINGS EITHER logged in as the Administrator or with the "Run as Administrator' option

Uninstall XAMPP and delete the XAMPP folder.

DL the ZIP file version. Expand it. Copy the XAMPP folder to C:\

'install XAMMP" by going to a command prompt,
cd \xampp
setup_xampp.bat

That will 'install and configure' XAMPP - and may fix your problem

IF NOT or you used the ZIP setup -

'm guessing you are using the XAMPP Control Panel? The original version has some problems in XAMPP 1.7.4. BUT - it is probably NOT the cause of your issues.

Try downloading and installing the new version - it has better diagnostics. :)

Read:
viewtopic.php?f=16&t=46743

DL:

http://arloh.de/xampp/xampp_control3.0.2.zip

When its installed/copied to the XAMPP folder, start xampp-control3.exe

Run the net-stat and see what it thinks is going on with Port 80 / 443

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: ERROR Apache Service not Started -1

Postby kevinpclarke » 08. September 2011 08:47

Hi JonB,

I used the installer so will follow your instructions and see what happens.

Many thansk for your help - I'll post the results later today.

Regards
kevin
kevinpclarke
 
Posts: 6
Joined: 07. September 2011 13:36

Re: ERROR Apache Service not Started -1

Postby kevinpclarke » 08. September 2011 12:42

Hi JonB,

I uninstalled Xampp and installed via the Zip making sure to run as administrator. However, this still fails to start the Apache Service. I then downloaded the newer Xampp Conrtol panel V 3.02 and as you said it certainly gives some excellent debugging information. Clearly Mysql is now starting and stopping ok but the Apache Service is not starting and suggests something is using Port 80 ... I Tried to enable the error amd access logs for the Apache server but nothing is being logged in these files. Looking at the Netstat output from Xampp control it just says 0.0.0.0 80 4 System.

If I look on my REsource monitor in Windows 7 under Listening Ports:
Image PID Address Port Protocol Firewall Status
System 4 IPv6 unspecified 80 TCP Not allowed, not restricted

Here is the Output from Xampp Control - I ran this as administrator

11:20:57 AM [main] Initializing main
11:20:57 AM [main] Windows version: 6.1 (build 7601) - Service Pack 1
11:20:57 AM [main] Xampp version: 1.7.4
11:20:57 AM [main] Control center version: 3.0.2 [ Compiled: Jul 21th 2011 - build #1 ]
11:20:57 AM [main] Running as admin - good!
11:20:57 AM [main] Working with basedir: "c:\xampp\"
11:20:57 AM [main] Initializing moduls
11:20:57 AM [apache] Possible problem detected: Port 80 in use by "system"!
11:20:57 AM [mysql] Possible problem detected: Port 3306 in use by "mysqld.exe"!
11:20:57 AM [main] Starting check-timer
11:22:10 AM [apache] Starting apache service...


I have many times rebooted as you know what wondows can be like for reboots.. :-) I have also stopped my Kaspersky Anti-virus and window Firewall in case something was blocking but still see the same problem..

If you have any ideas I'd very much welcome themas I'm confused why it thinks port 80 is blocking up..

Kind regards
Kevin
kevinpclarke
 
Posts: 6
Joined: 07. September 2011 13:36

Re: ERROR Apache Service not Started -1

Postby hackattack142 » 08. September 2011 14:40

Try checking this thread, I think it describes the same issue and offers some solutions that worked for people: viewtopic.php?f=16&t=45029
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: ERROR Apache Service not Started -1

Postby JonB » 08. September 2011 15:07

Hackattack is on the right trail

11:20:57 AM [apache] Possible problem detected: Port 80 in use by "system"!
11:20:57 AM [mysql] Possible problem detected: Port 3306 in use by "mysqld.exe"!

the first problem is likely caused by this:
Image PID Address Port Protocol Firewall Status
System 4 IPv6 unspecified 80 TCP Not allowed, not restricted

read this:

http://www.cameroncooke.com/2009/01/25/ ... -solution/

You did install the new Control Panel, right???

NET-STAT and Win-Services will help you with these. There is a tool called ProcessExplorer that can identify all the current Windows Processes, if you can't get to the root of what System is running.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: ERROR Apache Service not Started -1

Postby kevinpclarke » 09. September 2011 20:11

Hi JonB and Hackattack,

I think I'm almost there... I followed your suggestions and it seems like a service called "Web Deployment Agent Service" was running and using port 80. I've no idea where this came from, but after stopping this service and placing this process to manual there were no more '0.0.0.0 80 system' clases being reported via netstat from the new control panel.

However.... It appears I'm only able to run Apache & Mysql services via 'xamp_start' as you know this opens a cmd window and runs until i execute xamp_stop. I was able to access http://localhost/phpmyadmin via this method.

If I use either the older xamp_control or the newer xamp_control3 (Very latest version) Apache does not start only mysql appears to start and stop normally.. Why would only Apache not start via the control panel? I did try setting the config for auto start of both Apache and Mysql ,but this dos not make any difference.

I've attached some debug output below in case this helps as it looks like I'm almost there.. I highlighted in bold some points whch look interesting. I.e. in the error.log output - the error message "PHP Warning: file_get_contents(lang.tmp) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in C:\\xampp\\htdocs\\xampp\\index.php on line 2" - Is this relevant or just a bougus message from the error log?

The debug output below is Using [b]"xamp_control3". I set the config for ‘Very many details’ setting[/b]

7:20:50 PM [main] Initializing main
7:20:50 PM [main] Windows version: 6.1 (build 7601) - Service Pack 1
7:20:50 PM [main] Xampp version: 1.7.4
7:20:50 PM [main] Control center version: 3.0.2 [ Compiled: Jul 21th 2011 - build #1 ]
7:20:50 PM [main] Running as admin - good!
7:20:50 PM [main] Working with basedir: "c:\xampp\"
7:20:50 PM [main] Initializing moduls
7:20:50 PM [apache] Initializing module...
7:20:50 PM [apache] Checking for service (name="Apache2.2"): Service installed
7:20:50 PM [apache] Checking default ports...
7:20:50 PM [mysql] Initializing module...
7:20:50 PM [mysql] Checking for service (name="mysql"): Service installed
7:20:50 PM [mysql] Checking default ports...
7:20:50 PM [filezilla] Initializing module...
7:20:50 PM [filezilla] Checking for service (name="FileZilla Server"): Service not installed
7:20:50 PM [filezilla] Checking default ports...
7:20:50 PM [mercury] Initializing module...
7:20:50 PM [mercury] Checking default ports...
7:20:50 PM [tomcat] Initializing module...
7:20:50 PM [tomcat] Checking default ports...
7:20:50 PM [main] Enabling autostart for module "apache"
7:20:50 PM [main] Enabling autostart for module "mysql"
7:20:50 PM [main] Starting check-timer
7:20:51 PM [apache] Autostart active: starting...
7:20:51 PM [apache] Starting apache service...
7:20:51 PM [apache] Executing "net start "Apache2.2"" <- (No status change detected: running after this point)
7:20:51 PM [apache] Return code: 0
7:20:51 PM [mysql] Autostart active: starting...
7:20:51 PM [mysql] Starting mysql service...
7:20:51 PM [mysql] Executing "net start "mysql""
7:20:52 PM [mysql] Status change detected: running
7:20:53 PM [mysql] Return code: 0

The Debug output below is when starting the services via [b]'xamp_start', this was the error log created as follows:[/b]

[Fri Sep 09 19:00:55 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Sep 09 19:00:55 2011] [notice] Digest: done
[Fri Sep 09 19:00:56 2011] [notice] Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Fri Sep 09 19:00:56 2011] [notice] Server built: Oct 18 2010 01:58:12
[Fri Sep 09 19:00:56 2011] [notice] Parent: Created child process 4120
[Fri Sep 09 19:00:57 2011] [notice] Digest: generating secret for digest authentication ...
[Fri Sep 09 19:00:57 2011] [notice] Digest: done
[Fri Sep 09 19:00:58 2011] [notice] Child 4120: Child process is running
[Fri Sep 09 19:00:59 2011] [notice] Child 4120: Acquired the start mutex.
[Fri Sep 09 19:00:59 2011] [notice] Child 4120: Starting 150 worker threads.
[Fri Sep 09 19:00:59 2011] [notice] Child 4120: Starting thread to listen on port 443.
[Fri Sep 09 19:00:59 2011] [notice] Child 4120: Starting thread to listen on port 80.
[Fri Sep 09 19:02:27 2011] [error] [client 127.0.0.1] PHP Warning: file_get_contents(lang.tmp) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in C:\\xampp\\htdocs\\xampp\\index.php on line 2
[Fri Sep 09 19:07:21 2011] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Fri Sep 09 19:07:21 2011] [notice] Child 4120: Exit event signaled. Child process is ending.
[Fri Sep 09 19:07:22 2011] [notice] Child 4120: Released the start mutex
[Fri Sep 09 19:07:23 2011] [notice] Child 4120: All worker threads have exited.
[Fri Sep 09 19:07:23 2011] [notice] Child 4120: Child process is exiting
[Fri Sep 09 19:07:23 2011] [notice] Parent: Child process exited successfully.

I guess I'm still missing something else - I have removed the c:\xamp and copied in fresh again and ran setup_xampp via cmd.

As always any ideas/suggestions would be appreciated

Many thanks for your help

Kind regards
Kevin
kevinpclarke
 
Posts: 6
Joined: 07. September 2011 13:36

Re: ERROR Apache Service not Started -1

Postby hackattack142 » 09. September 2011 22:23

My guess is that the 'xampp-start' just launches the .bat files in the same directory. The bat files launch the applications directly (ie via httpd.exe not via the Services which is why they probably are working for you. You could open your services and look for the Apache2.2 service. If you go to the service properties, and look at the "path to executable", you can verify that it is correct. It should be something like ""C:\xampp\apache\bin\httpd.exe" -k runservice". Using the new control panel, you can uncheck the service to uninstall it and recheck it to reinstall it to make sure it is installed correctly.

Edit:
I looked at the XAMPP Start source code and it just executes the Apache and MySQL programs directly regardless of if you have them installed as a service or not:
Code: Select all
char *start[10][10] = {
            {"apache\\bin\\httpd.exe", "-f conf\\httpd.conf", NULL},
            {"mysql\\bin\\mysqld.exe", "--defaults-file=mysql\\bin\\my.ini", "--standalone",  NULL},
            {NULL}
         };
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: ERROR Apache Service not Started -1

Postby kevinpclarke » 10. September 2011 15:43

Hi Hackattack,

Many thanks for your comments - You were certainly correct about the Apache 2.2 executable path - It was set to C:/users/kevin/.... This must have been when I installed xampp via the installer instead of the Zip.. I must have altered the default path from c: to C:/users/kevin... ... I did de-install as recommended but I guess this did not alter services. The Apache service now starts as I altered the path via the registry. However, It only lets me get to http://localhost and not to phpmyadmin.. I wonder if I have the same path issue for Mysql because if I do a status it says Mysql database is deactivated as below:

MySQL database DEACTIVATED
PHP ACTIVATED
HTTPS (SSL) ACTIVATED
Common Gateway Interface (CGI) ACTIVATED
Server Side Includes (SSI) ACTIVATED
SMTP Service DEACTIVATED
FTP Service DEACTIVATED
Tomcat Service DEACTIVATED

Like previously If I use xampp-start the database activates ok and I can get into phpmyadmin ok. So at this point I looked in the services for Mysql and the path it is executing as follows:

"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL

I assume this is again incorrect? Should it be something like: C:\xampp\mysql\bin\mysqld --defaults-file=mysql\bin\my.ini --standalone --console... Is this the correct path to use in my services for Mysql?

Please let me know what you think?

Once again may thanks for your help

Regards
Kevin
kevinpclarke
 
Posts: 6
Joined: 07. September 2011 13:36

Re: ERROR Apache Service not Started -1

Postby hackattack142 » 10. September 2011 16:48

You are correct, that is not what the path should be for a ZIP install. If you have MySQL installed in that location, you should uninstall it if you are planning on using XAMPP to avoid conflict.

You can delete the old service by running the following command from the command line:
Code: Select all
sc delete MySQL


This way you do not have to bother editing the registry.

You can reinstall the service by checking the check by MySQL in the XAMPP Control Panel (make sure it is the new one) and it should have the correct path.

After installing it from the CP, my MySQL service path looks like this: "C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql"
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: ERROR Apache Service not Started -1

Postby kevinpclarke » 10. September 2011 17:30

Hi Hackattack,

Oh Wow we are there now..

I can get into phpmyadmin now it looks like I just need to set a password for Mysql and this other issue to look at about 'Linked tables have been deactivated' - I thought I saw some entries about this on the forum

Thanks s much for all your help - Many thanks also to JonB as well - You have been great! :D

Many thanks again and have great weekend

Kind regards
Kevin
kevinpclarke
 
Posts: 6
Joined: 07. September 2011 13:36


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 116 guests