How to restart apache

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

How to restart apache

Postby horseatingweeds » 12. August 2010 20:04

How are you supposed to restart Apache without restarting the whole operating system? I'm using xampp on win xp running apache and mysql as services. I've tried running xampp_restart.exe, but it doesn't appear to do anything. I've tried using the control panel too. Refresh on there does nothing I can see. Clicking the stop button stops Apache sure enough, but the start button then does nothing - I have to restart the OS to get things running again.

Making changes to php.ini would be much easier if there were a way to restart apache without a reboot. Any advice is appreciated. Thanks.
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby JonB » 12. August 2010 23:29

couple questions?

Have you ever previously installed Apache standalone, WAMP or an earlier instance of XAMPP?

You do leave the 'Svc' box checked, when you stop Apache?

Other than the start/stop issue, Apache is working correctly? You can access the XAMPP page and anything you may have added to \xampp\htdocs?

You should check the Apache error log to see what it thinks is happening.

If you have XAMMP properly installed, the Control Panel will stop and start Apache properly. :)

:?:
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: How to restart apache

Postby horseatingweeds » 13. August 2010 03:09

Thanks JonB,

You gave me the confidence to try another stop/start in the control panel in order to harvest some fresh error messages. But instead Apache stopped and restarted politely and the error messages were clean:

Code: Select all
[Thu Aug 12 21:55:25 2010] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Thu Aug 12 21:55:25 2010] [notice] Child 3624: Exit event signaled. Child process is ending.
[Thu Aug 12 21:55:26 2010] [notice] Child 3624: Released the start mutex
[Thu Aug 12 21:55:27 2010] [notice] Child 3624: All worker threads have exited.
[Thu Aug 12 21:55:27 2010] [notice] Child 3624: Child process is exiting
[Thu Aug 12 21:55:27 2010] [notice] Parent: Child process exited successfully.
[Thu Aug 12 21:55:36 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Aug 12 21:55:36 2010] [notice] Digest: done
[Thu Aug 12 21:55:37 2010] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9 configured -- resuming normal operations
[Thu Aug 12 21:55:37 2010] [notice] Server built: Dec 10 2008 00:10:06
[Thu Aug 12 21:55:37 2010] [notice] Parent: Created child process 1080
[Thu Aug 12 21:55:38 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Aug 12 21:55:38 2010] [notice] Digest: done
[Thu Aug 12 21:55:39 2010] [notice] Child 1080: Child process is running
[Thu Aug 12 21:55:39 2010] [notice] Child 1080: Acquired the start mutex.
[Thu Aug 12 21:55:39 2010] [notice] Child 1080: Starting 250 worker threads.
[Thu Aug 12 21:55:39 2010] [notice] Child 1080: Starting thread to listen on port 443.
[Thu Aug 12 21:55:39 2010] [notice] Child 1080: Starting thread to listen on port 80.


Come to think, when I was actually having this problem was after I edited a php.ini to make XDebug work with Netbeans. I managed to do it, and it took a few tries, each time rebooting because Apache wouldn't restart or start after stopping. The next day, however, I found that PhpMyAdmin was throwing timeout errors when I tried importing files! Suspecting the resent changes, I reverted back to the pre-XDebug edits and it started working again.

Would something in the php.ini cause Apache to not start like this, or for that matter get in the way of PhpMyAdmin? The edits I made included adding some xdebug settings, gave zend_extension_ts a path, and commented out some Zend stuff as follows:

Code: Select all
[Zend]
;zend_extension_ts = "C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
;zend_extension_manager.optimizer_ts = "C:\xampp\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 0
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path =
; Local Variables:
; tab-width: 4
; End:

[XDebug]
;; Only Zend OR (!) XDebug
zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
xdebug.idekey=netbeans-xdebug
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby JonB » 13. August 2010 04:27

I don't use Xdebug, but I have seen complaints that it doesn't work right with XAMMP in this forum, why don't you search on that?

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: How to restart apache

Postby horseatingweeds » 13. August 2010 12:11

Oh - I've searched for that indeed. I gave up on Xdebugger though, and am now trying to enable Zend Debug. It's giving me the same problem though, and this time I've got more information. These are the php.ini settings I have for Zend. I have to use Zend extension manager because I've also got Zend Optimizer.

Code: Select all
[Zend]
zend_extension_ts = "C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
zend_extension_manager.optimizer_ts = "C:\xampp\php\zendOptimizer\lib\Optimizer"
zend_optimizer.enable_loader = 0
zend_optimizer.optimization_level=15
;Zend debug
zend_extension_manager.debug_server_ts= "C:\xampp\php\ZendDebug"
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=always
;zend_optimizer.license_path =
; Local Variables:
; tab-width: 4
; End:


My extension is here: C:\xampp\php\ZendDebug\php-5.2.x\ZendDebugger.dll

After making these settings, I shut down Apache. I then try restarting by clicking the Start button but the button doesn't change. In the info box underneath it says Apache starts. And according to the logs Apache starts. And the websites I have running on Apache seem to function ok. But I can't stop Apache now. I tried the xampp_restart.exe. It made no change but did bring up a cmd for a few seconds with an error message - something about not finding a file in mysql/bin - or something similar.

Any ideas here?
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby JonB » 13. August 2010 19:05

. It made no change but did bring up a cmd for a few seconds with an error message - something about not finding a file in mysql/bin - or something similar.


it is useful to know what the errors actaully are, they are usually key to solving said problem.

If you can't catch the startup/shutdown errors:

Open a command window (Use the Command Prompt menu item or shortcut)

type "net start Apache2.2" or "net stop Apache2.2"

the action will be taken, and any run errors should be echoed to the command window.

Don't use the run option as the command window will not be persistent.

Type 'exit' to close the Command Window

Good Luck
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: How to restart apache

Postby JonB » 13. August 2010 19:15

As far as other ideas:

The xdebug that 'should work' is the one found in xampp\php\ext as it was compiled for this version of PHP as a DLL (XAMPP).

Any other extensions (dlls) you decide to incorporate must be compiled as 'VC6' and be specific to PHP version 5.3. VC6 means they were compiled with the Visual Studio 6 C compiler. They are the ONLY ones that will work with PHP for XAMPP, as the PHP here is an Apache DLL module. Thus the binaries to be used must be compatible with the Apache Software Foundation's Apache binaries that come with XAMPP. Much of the new Zend stuff is VC9 compiled and proabably won't wotrk with XAMPP (reasd teh left column here:)

http://windows.php.net/download

Good Luck
:mrgreen:
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: How to restart apache

Postby horseatingweeds » 13. August 2010 20:55

Where do you run those commands at in the command window? On [path]\xampp\apache? I've been searching around but every explanation seems to assume you already are addressing apache in the cmd.
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby JonB » 14. August 2010 01:25

As they are really Microsoft service commands, they should execute just about anywhere. You are invoking net.exe which is located in c:\windows\system32 -- which is in the default path.

"NET" is a toolbox part for the command line interface. Its used extensively in batch file scripting.

http://www.windowsitpro.com/article/joh ... ence-.aspx

It does an amazing number of things

:mrgreen:
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: How to restart apache

Postby horseatingweeds » 14. August 2010 01:39

I've got more information. Xdebug is incompatible with Zend Optimizer, so you have to disable it. So I just tried commenting out the Zend stuff and made no changes/additions for Xdebug, and that alone caused the weird XAMPP control panel problem, produced the error - Can't find process: C:\xampp\apache\bin\mysql.exe in the cmd box, and after a reboot to correct the problem the first log file produced was: C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

Can anyone decipher this? It seems something is relying on Zend optimizer?
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby JonB » 14. August 2010 01:53

actually it brings a different question -

Have you previously installed Apache or MySQL standalone, or is there another XAMPP install on the machine?

:?:
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: How to restart apache

Postby horseatingweeds » 14. August 2010 02:01

No other XAMPP installations. When I first installed XAMPP though, there was some problem. I think I installed Apache and mysql without making them services. But I removed it and installed it again.

With the error: pid file C:/xampp/apache/logs/httpd.pid overwritten does that mean there could be a port conflict?

What would cause the Can't find process: Apache/mysql/bin/mysql.exe error?
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby horseatingweeds » 14. August 2010 19:28

I know all that Wole. But it doesn't explain the errors. Why is XAMPP looking in Apache/mysql/bin/mysql.exe? And why would "pid file C:/xampp/apache/logs/httpd.pid overwritten".
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Re: How to restart apache

Postby JonB » 16. August 2010 02:08

A. -
Why is XAMPP looking in Apache/mysql/bin/mysql.exe?


I'll hazard a guess that Apache was installed previously in standalone mode.

B. -

"pid file C:/xampp/apache/logs/httpd.pid overwritten".


This message occurs when Apache is restarted. The PID file is the process ID file that is used by Windows Task Manager (and the OS) to track running processes. The restart creates a new instance of the process. There are actually 2 instances of the httpd.exe process started by Apache for Win32.

http://www.mydigitallife.info/2008/12/0 ... n-windows/

Here's how to find out what is going on with Apache.

Use the Service Control Management console. Yo can start it from Control Panel, My Computer > Manage or the XAMPP Control Panel (SCM button)

Look for Apache2.2 in the list - Right Click and select Properties - check the 'path to executable' and if it is not "c:\xammp\apache\bin\httpd.exe" -k runservice -- you have the problem.
(the drive letter or folder name could be different if you installed XAMMP, say on D:, or in a different folder)

If that is the case - you need to uninstall the Apache standalone instance.

:mrgreen:
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: How to restart apache

Postby horseatingweeds » 16. August 2010 12:12

Hmmm, that's not the problem then. I just checked. The path to executable for Apache2.2 under services is "c:\xampp\apache\bin\httpd.exe" -k runservice

And like I said, I've never installed anything but XAMPP on this machine - server wise. I did, however, uninstall XAMPP and reinstall it a year ago.
horseatingweeds
 
Posts: 20
Joined: 10. September 2009 03:17

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 43 guests