# RE: [PHP] Can php auto execute it's script in schedule without opening a webpage?

> Dear all
> I just wonder did anyone know if php can act as a scheduler rather
than
> execute script manually?
> i want to set a schedule for php to run certain script at specify
time, to
> what i understood in php is : the script can only be process when a
> homepage
> had been execute. but i want the script to be excute even no one open
a
> homepage contain php script in it!

Sure. Write the PHP script you want to use. There shouldn't be any
output from the script or it should all go to a database or file, since
no one will be executing it to see it.

Use "cron" on a *nix server to schedule when you want it to run. You
should have a standalone version of PHP installed somewhere and you can
just do php -q filename.php as what you want to run. You can also run it
through lynx or wget if you don't have a standalone version of PHP
available. Lynx --dump http://yourdomain/file.php.

If you're on Windows, you can use task scheduler to run the program
through php.exe like php.exe -q c:\path\to\file.php. Or you can load it
up through Internet Explorer, iexplore.exe http://youdomain/file.php. If
you use IE, there is a checkbox in the Task Scheduler program that will
end the program after X minutes. Check that to have it shut down IE
after a couple minutes, you PHP script should be done executing by then.

Hope that helps.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php