Why do I need to stop and start XAMPP every day for mySQL?

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

Why do I need to stop and start XAMPP every day for mySQL?

Postby normenclature » 09. August 2004 16:54

For some reason, mySQL loses its connectivity and in order to reconnect I have to stop XAMPP and then restart it again. :? Is there some kind of setting I need to configure in order to have it continuously "ON"?

I'm very new to mySQL, PHP, etc. but I'm learning fast and I have everything now running great. This one thing is really bothering me though. :( Thanks for any help you can offer :)
normenclature
 
Posts: 3
Joined: 09. August 2004 16:44
Location: Mesa, Arizona, USA

Postby forethought » 10. August 2004 00:01

I have a similar problem, after about 5-6 hours, apache seems to stop working for me, I cannot access my index page via http://localhost or any other means, I have to shut down xampp and restart it.

I just tried installing apache and mysqul as a service, so we'll see if that changes anything.
forethought
 
Posts: 6
Joined: 09. August 2004 23:44
Operating System: OS X 10.7.2

Postby normenclature » 10. August 2004 17:23

If that works, let me know how to do it will you?

I have no clue how to install those as services. Thanks!
normenclature
 
Posts: 3
Joined: 09. August 2004 16:44
Location: Mesa, Arizona, USA

Postby forethought » 10. August 2004 22:57

That seemed to do the trick for me, to install Apache as a service, first make sure you stop the xampp program, and then run this batch file:

ApacheFriends\xampp\apache\apache_installservice.bat

Then run this batch file to install MySQL as a service:

ApacheFriends\xampp\mysql\mysql_installservice.bat

After that both should start each time your machine boots up.

Good luck.
forethought
 
Posts: 6
Joined: 09. August 2004 23:44
Operating System: OS X 10.7.2

Thanks! Have you needed to stop and restart XAMPP yet?

Postby normenclature » 30. August 2004 19:19

You said that it worked for you. What you mean is that your mySQL and Apache server start and never STOP day after day?

Thanks again for the input-- I'd appreciate just one last response to confirm with no possibility of miscommunication.

Take Care!

n
normenclature
 
Posts: 3
Joined: 09. August 2004 16:44
Location: Mesa, Arizona, USA

Postby forethought » 31. August 2004 01:12

Yep, that's it, after you install them both as a service, when you turn your machine on they never stop (at least mine haven't since I've done that). Though, if I'm not mistaken whenever you have to make changes to the httpd.conf file, you must stop the server, and whenever I do that I just reboot the machine so that both Apache and MySQL will automatically start back up on startup.

I hope this answers your question, and if not let me know and I'll try and be more specific.
forethought
 
Posts: 6
Joined: 09. August 2004 23:44
Operating System: OS X 10.7.2

Re: Why do I need to stop and start XAMPP every day for mySQ

Postby ozental_uk » 31. August 2004 21:40

normenclature wrote:For some reason, mySQL loses its connectivity and in order to reconnect I have to stop XAMPP and then restart it again. :? Is there some kind of setting I need to configure in order to have it continuously "ON"?

I'm very new to mySQL, PHP, etc. but I'm learning fast and I have everything now running great. This one thing is really bothering me though. :( Thanks for any help you can offer :)


I'm actually getting the same problem. Mine seems to be OK for several hours and then dies, but sometimes the site is up for more than 24 hours without a problem and then dies. So frustrating.

When I have tried installing Apache and MySQL as services, I don't seem to be able to re-connect to the web site after a reboot - and yeah, they are certainly running as seen in Control Panel/Admin Tools/Services, so I usually end up uninstalling them as a service.

One thing I tried to date was a batch file that is scheduled every 6 or so hours:

start /wait c:\xampp\xampp_stop.bat
start /wait c:\xampp\xampp_start.bat

It kind helps, but not always. Today, either Apache or MySQL died after just 30 minutes or so.

Is there any way to see why it dies? Logs?
ozental_uk
 
Posts: 21
Joined: 30. July 2004 22:17

Postby scebbrell » 01. September 2004 17:35

I have always run as a service and I have never had a single problem running 24/7, it's running on my main machine in the background whilst I get on with the real work. I have Windows caching set to give priority to background tasks but that is all.

If you make changes to any of the configuration files all you need to do is to restart the Apache service, this has the effect of restarting PHP and MySQL as they both depend on Apache running.
scebbrell
 
Posts: 19
Joined: 27. April 2004 14:43
Location: Oldham, UK.

Postby ozental_uk » 05. September 2004 11:17

Well I tried installing Apache and mySQL as a service and again, Apache sticks after 'x' hours. Currently I am trying an automatic scheduled event to restart Apache every 1 hour and so far, it looks promising. If you are having problems with Apache hanging after 'x' hours, you might want to try this:

1. Install Apache as a service.

2. Create an MS-DOS patch file that does:

cd\xampp\apache\bin
apache -n "service name" -k restart

3. Schedule it to run every hour.

=======================================================
Here's other info I collected from the Net:

Controlling Apache in a Console Window

You can tell a running Apache to stop by opening another console window and running:

apache -k shutdown

Note: This option is only available with Apache 1.3.3 and later.

For earlier versions, you must use Control-C in the Apache console window to shut down the server.

From version 1.3.3 through 1.3.12, this should be used instead of pressing Control-C in a running Apache console window, because it allowed Apache to end any current transactions and cleanup gracefully.

As of version 1.3.13 pressing Control-C in the running window will cleanup Apache quite gracefully, and you may use -k stop as an alias for -k shutdown. Earlier versions do not understand -k stop.

You can also tell Apache to restart. This makes it re-read the configuration files. Any transactions in progress are allowed to complete without interruption. To restart Apache, run:

apache -k restart
=======================================================
To start Apache as a service, you first need to install it as a service. Multiple Apache services can be installed, each with a different name and configuration. To install the default Apache service named "Apache", choose the "Install as Service for All Users" option when launching the Apache installation package. Once this is done you can start the "Apache" service by opening the Services window (in the Control Panel, hidden in "Administrative Tools" on Windows 2000), selecting Apache, then clicking on Start. Apache will now be running, hidden in the background. You can later stop Apache by clicking on Stop. As an alternative to using the Services window, you can start and stop the "Apache" service from the command line with
NET START Apache2
NET STOP Apache2

See Controlling Apache as a Service for more information on installing and controlling Apache services.
Apache, unlike many other Windows NT/2000 services, logs most errors to its own error.log file, in the logs folder within the Apache server root folder. You will find few Apache error details in the Windows NT Event Log. Only errors as Apache attempts to start are captured in the Application Event Log.
After starting Apache as a service (or if you have trouble starting it) you can test it using the same procedure as for running in a console window. Remember to use the command:

apache -n "service name"

to assure you are using the service's default configuration
=============================================================
Select Apache from the Control Panel's Service dialog and click Startup.
Verify that the service account is correct. You may wish to create an account for your Apache services.
Retype the password and password confirmation.
Go to User Manager for Domains.
Click on Policies from the title bar menu, and select User Rights.
Select the option for Advanced User Rights.
In the drop-down list, verify that the following rights have been granted to the selected account:
Act as part of the operating system
Back up files and directories
Log on as a service
Restore files and directories
Confirm that the selected account is a member of the Users group.
Confirm the selected account has access to all document and script directories (minimally read and browse access).
Confirm the selected account has read/write/delete access to the Apache logs directory!
=============================================================
Controlling Apache as a Service
Multiple instances of Apache can be installed and run as services. Signal an installed Apache service to start, restart, or shutdown/stop as follows: apache -n "service name" -k start
apache -n "service name" -k restart
apache -n "service name" -k shutdown
apache -n "service name" -k stop
For the default "Apache" service, the -n Apache option is still required, since the -k commands without the -n option are directed at Apache running in a console window. The quotes are only required if the service name contains spaces.
ozental_uk
 
Posts: 21
Joined: 30. July 2004 22:17


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 113 guests