schedule task in windows 2008 server for php file - php

i have shared hosting on windows 2008 server and one project in php.
actually i want to run one php file once in a day automatically...
i want to run one schedule task once
in day.
any php code, jquery or ajax
for information.
i have access to ftp to up load files to my domain but i don't have sever access and its windows 2008 server.
how can i run schedule task in php on windows 2008 server?
Thanks

If you don't have access to the server where you can set a schedule job then below are your probable options:
Create a php file on server W(windows2008) then if you have a free hosting account at server L(Linux) where you can setup cron job, then creating a CURL to access server W would do.
If your page is access often the creating a JS script with setTimeout("myAjaxFunction", 10000) would also do but it's an awkward approach as you assumed that user browser open accessing yoursite somewhere else.

Related

How can I execute PHP in the background of my server?

I'm new to server-side programming and running a server in general, and I'm using xampp. I have a hellp.php file in the htdocs directory of xampp, and that's how I run my PHP code. However what I'm looking for, is to have some PHP code execute in the background of my server (not on a webpage). I'm looking for a sort of php application that just runs in the background and does stuff whenever the server starts up.
For example, in this case I want to retrieve some data from Facebook's Graph (a list of conversations from a facebook page) every X seconds and store it in a SQL database somewhere. How can I accomplish this?
Linux
If you're on linux, you can create a cron job as described here by #IliaRostovtsev.
Windows
If you're on windows, use scheduled tasks as described here by #Pierre.

Can PHP trigger an event on a remote Windows Server

Is there a way for PHP to send a signal to a Windows Server to run a script?
I am writing a web application which generates database entries that are later synced by a program on a remote Windows Server. PHP & mySQL are running on AWS.
The application on the windows server syncs the mySql database with Quickbooks. Ideally I would like to send a signal from PHP so that if PHP has updated the database, letting the remote Windows server know which script to run to in order to initiate the sync program. I would need to be pointed in the right direction both on the PHP commands as well as how to setup the listening service on Windows.
I was thinking if I could get Windows to listen on a specific port for a short XML file, PHP could send a password and entity ID number to identify which script to run.
Any suggestions?
Thanks!
You can use php on both end. Just install php server on windows, then when request happened execute a windows command. Php can do that.
I would schedule a task to read a specific file from the windows server side and from the php side you could use cron jobs. This question is too broad though and there are several approaches to that. You need to be more "code" specific.

I need something like CRON but for IIS 8.5/PHP on Windows Server 2012R2

This PHP script has to run every twenty two seconds. How can I pull this off without CRON on a Linux box?
C:\inetpub\wwwroot\4dalulz.com\webcam_network\grabimage_cam_18_331103_-64_795038_17z.php
Do you have a basic windows hosting account or is this a standalone box that you have admin access to? If it is a box that you have admin rights to then in windows you can use Task Scheduler, or AT which is a lightweight system like cron. Here is Microsofts link on AT and how to use it http://support.microsoft.com/en-us/kb/313565
If you have shared windows hosting then it gets more complicated. You might want to configure an outside service to request a web-accessible script on your schedule to perform your actions. Something like https://www.setcronjob.com/

How to setup cron jobs on Windows?

I developed notification.php to send a notification email to the users and I it works successfully inside a page of my web site now I want to create a cron job to run this page in regular time not associated to refreshing that page. I have not done this before and I barely know cron jobs
After watching this video :
https://www.youtube.com/watch?v=S-UZsAk_UiE
Where can I find cPanel?
My System specifications are:
1- MySQL database
2- Windows Server 2008 Enterprise
You can't install cPanel on Windows. It's Linux only. Windows uses "Task Scheduler". You might want to check this out: https://support.qualityunit.com/384836-How-to-set-up-cron-job-on-a-Windows-server

Automatically Restarting a chat server application on system restart

I developed a chat application with an attendant chat server. Everything is working fine. The issue now is the fact that whenever the chat server goes down (for instance, the server system shuts down as a result of power failure or some other problem), by the time the server system come back on, the chat server would have to be restarted manually.
I believe (and I know) it is more appropriate for the chat server application to restart itself when the computer comes back on (and of course regardless of who is logged in and of course, even before anyone logs in). I have a batch file that executes the chat server. My attempt was to create a windows service that start automatically and runs this batch file using a Network Service account on the server system. Although, I'm having a hard time with this (temporarily), I would love to ask if there are any alternatives to using a windows service. Suggestions are highly appreciated.
Creating a windows service will be the better solution, but you can add your batch file into the startup folder.
I think you are already having the better solution (Wibndows Service). Along with adding an email alert or some sort of alert when the server restarts will be handy (?).
I would probably just start the server using the Windows Task Scheduler. You can set a task to start on system startup:

Categories