Results 1 to 5 of 5

Thread: Automatically restart IIS 6.0 when 'Service Unavailable'

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    39

    Automatically restart IIS 6.0 when 'Service Unavailable'

    How do I restart IIS when the error Sevice unaviable is occuren. Does anybody have such php script or can wirte such script.

    thanks in advance
    Ramesh chaudhary

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Automatically restart IIS 6.0 when 'Service Unavailable'

    If you could write a batch file that restarted the server, then you could restart the server using PHP. I don't know how you'd go about doing that, but you should look into it. Then, you can use exec() or shell_exec() to execute the batch file.

    Now, how you would run a PHP script on an IIS server that was unavailable? I would have to say that it's impossible, as PHP is run "inside," if you will, the webserver, and if the server is unreachable, your PHP script is unreachable. you would need a program running in the background to check if it was down, and if so, that restarted it as well.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Automatically restart IIS 6.0 when 'Service Unavailable'

    Quote Originally Posted by RameshChaudhary
    How do I restart IIS when the error Sevice unaviable is occuren. Does anybody have such php script or can wirte such script.

    thanks in advance
    Ramesh chaudhary
    But if IIS is running your PHP scripts, how would you get it to execute in the first place? You'll need to start it directly from the server.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    39

    Re: Automatically restart IIS 6.0 when 'Service Unavailable'

    Is it possibel to creat batch file restartig IIS automatically when Service unaviable????

    Rmaesh chaudhary
    NEPAL

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Automatically restart IIS 6.0 when 'Service Unavailable'

    Yes. Just give it the command iisreset.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width