Connect Tech Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 14 July 2013

How to schedule a PHP script in task scheduler

Posted on 22:35 by Unknown
Quiet often there is a need to execute/run php script on some time interval at server side. And that php scripts should run automatically on windows server. You can add a task in windows task scheduler to run PHP script. 

PHP script can be executed easily on command prompt using the below command:
ex. C:\Path\to\php.exe -f "C:\Path\to\file.php"    
where -f is file attribute - parse and execute file.


Follow the below given steps to configure the PHP script to run in task scheduler.

1. To open task scheduler, click on Start >> Administrative Tools >> Task Scheduler.

2.Click on "create task" from "Actions" menu bar on right pane.




















3. In General tab, enter the name of the task.

4. In triggers tab, click on New and schedule the time at which script should execute, as per your requirements.




5.In Action tab, click on new and select 'Start a program' from Action option.Enter the path of PHP.exe in program/script field. Now enter the file option ex: -f c:\pathToHtdocs\fileName.php in Add Arguments field and click on Ok.



6. In condition tab, it is recommended all the option to default.




7. In settings tab, you can configure the options as per your requirements.


8. You are done with scheduling the PHP script, now you can select 'Run' option from options menu, to execute the task.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • How to schedule a PHP script in task scheduler
    Quiet often there is a need to execute/run  php  script on some time interval at server side. And that php scripts should run automatically ...
  • HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to run CGI applications.
    If you get the error “HTTP Error 403.19 – Forbidden The configured user for this application pool does not have sufficient privileges to...
  • Roles and Features showing an error HRESULT: 0x800F0818 in Server Manager of windows server 2008 R2
    When you open Server Manager both Roles and Features display Error and you are unable to add any role or features. When you select the det...
  • 503 This mail server requires authentication when attempting to send to a non-local e-mail address
    If you are facing the following error in receiving the emails for Plesk Webmail on Windows server: We recommend contacting the other email ...
  • How to Install Smartermail 9
    This article walks you through the installation of SmarterMail 9 on your Windows server. Please note that Smartermail 9 requires ASP.net 4...
  • Disallowed Parent Path
    If you are unable to access the website and facing the below error: Active Server Pages error 'ASP 0131' Disallowed Parent Path /adm...
  • Unable to shrink database log file ( DBCC shrinkfile gives error)
    Sometimes when trying to shrink the database log file for Ms SQl Database using DBCC SHRINKFILE ('database-name_Log', 1), which is...
  • Could not load file or assembly \'CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0
    If you face the below crystal report related error, kindly search the required crystal report from following link and install it. http://sc...
  • How to Change RDP Port
    The setting for the Terminal Services port lives in the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Termina...
  • How to configure IIS 7 to redirect non-www domain to www domain?
    One of few legacy leftovers that was never dropped over the years is the common use of www domain prefix. It is not a problem per se for us...

Categories

  • booting Process
  • linux
  • redhat

Blog Archive

  • ▼  2013 (68)
    • ▼  July (1)
      • How to schedule a PHP script in task scheduler
    • ►  May (2)
    • ►  April (11)
    • ►  March (54)
  • ►  2012 (44)
    • ►  September (20)
    • ►  August (1)
    • ►  July (4)
    • ►  June (12)
    • ►  May (2)
    • ►  March (4)
    • ►  February (1)
  • ►  2011 (1)
    • ►  February (1)
  • ►  2009 (9)
    • ►  September (3)
    • ►  August (2)
    • ►  June (1)
    • ►  May (2)
    • ►  March (1)
Powered by Blogger.

About Me

Unknown
View my complete profile