Run PHP script once a week

every monday i need to clear some fields of MYSQL database. I have

At first I thought about using the cron job, but my web hosting provider (fatcow.com) does not support either SSH or command lines on shared servers.

I also thought about checking the date () to see if it goes on Monday and something works, but then I need to run this particular page all the time, and I read that this is the problem.

So now I ask you, how can I do this?

thanks for answers

+3
source share
6 answers

If your work can be reached via the URL, you can try registering with the free crontab service, for example onlinecronjobs.com

+1

, cron, php url . curl, wget streams.

+3

, cron, FatCow , cron, wget php script - , wget http://example.com/fake-cron.php

+2

- mysql. 100% ,

CREATE EVENT something ON SCHEDULE

, , MySQL PHP. , , , .

MySQL

+1

What is the control panel for this host? Cpanel? If so, cPanel almost always has the Cron tool in the Advanced section. It is also possible to make exec or system commands from a php script to configure Cronjob (unless that means you don't support "command lines").

0
source

If you have access to another server (using ssh), just add the cron job to it, which infects your PHP script once a week. Unfortunately, I don't think there is a way to do this directly in your php script.

0
source

Source: https://habr.com/ru/post/1783202/


All Articles