Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:27:22+00:00 2026-06-04T16:27:22+00:00

PHP version 5.2.2.6 OS: Windows Server 2003 I am trying to write a PHP

  • 0

PHP version 5.2.2.6
OS: Windows Server 2003

I am trying to write a PHP script that will periodically check several windows services and restart any that are not running.

1) When I run from the web, the script works correctly.

2) When I run as scheduled tasks, the script runs but is unable to start any services.
I tried to output to a log text file. I see that it reports all services as stopped (even though some aren’t), issues a service start for each but nothing happens. When I run the script from DOS prompt, same result.

I’ve tried various ways to start service and I get the same result.
EX:

system('net start ApDSCService');

I also tried this example but same results: http://hotware.wordpress.com/2008/08/26/restarting-windows-services-in-a-php-script/

I don’t have the option to upgrade the PHP version as it would break some other sites hosted on the server.
Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:27:24+00:00Added an answer on June 4, 2026 at 4:27 pm

    Change the user in scheduled task (administrator if you can)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to install or use php on a windows 2003 server that already
My server have default php version of 4, so when I run some script
I am using wamp server 2.0 on windows XP with PHP version 5.2.5 when
I am running PHP 5.3.8 non-thread-safe version with IIS 7 on windows server 2008
I have Eclipse PDT version 1.3.0 PHP Version 5.3.8 Running on windows XP Pro
Here is my server information : APC Version : 3.1.9 PHP Version : 5.2.17
I am trying to find phpredis extension (php) for my development server, I know
I have started to learn PHP. So installed WAMP server on my windows 7
I am running PHP on a 64bit windows 2008 server. I have both ODBC
I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.