Is there a way for PHP to automatically perform processes? For instance, on my website I have a photo of the day application. However, currently it works by checking if it is a new day, and then replacing the photo with another. The script checks every time a user visits the page, which seems like a waste of processing. What I would like to know is if there is a way that I can have the script automatically execute every 24 hours. Thanks in advance.
PHP Automatic Processes
Collapse
X
-
Cron Jobs is what you want. If your provider... well provides the service, you can set how frequent you want a certain file to be run. So after you have searched for some information on the on this site and google, then ask your questions about cron jobs. Also check that your server does allow them. -
I am fuzzy about this so perhaps one of the others can answer it. If you want to run a PHP script from a cron job, and not as a page request sent to for example the Apache server, you are calling the script in CLI or command line interpreter mode. And on one of my Linux PC's, I had to install the php modules for this as they were not part of the default package. I am not sure just how standard it is for the CLI mode to be already available per default.
So if you might want to find out from your provider if calling php scripts in a stand alone fashion is available.Comment
Comment