I want some specific php script on my server to run automatically on certain time.
It may include sending an email reminder to clients or updating some information.
Please help me because I am stuck in the middle of my work
It depends on your run environment. You basically need three things: a PHP script, a PHP interpreter, and a scheduling application.
The script, you write.
PHP comes in two basic versions: a web server plugin or a standalone interpreter. You can automate processes either way, but using the standalone interpreter is easier. If you only have the plugin, you'll need some way to invoke a web browser and point it at the site. The text-only browser lynx is a good choice for this kind of thing -- it is designed to be run from a command prompt.
The availability and use of a scheduling application depends on your environment. If you're running on Linux or another Unix-like operating system, you'll almost certainly have cron available. On Win32, there are a lot more possibilities.
Write a script. Set up your scheduling application to run the script in PHP on a regular basis, either by direct invocation of the script or by invoking a browser and pointing it at your script through a web server.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.