File path for Cron job

Hi, I want to run a cron job to call a PHP script on my server. I am using cpanel from my web host and these are the options:

  • Minute:
  • Hour:
  • Day:
  • Month:
  • Day of the week:
  • Team:

I am really trying to point a command to my file. I use this line /home/abbeysof/public_html/adi/cron/daily.php, but I get this error:

/bin/sh:/home/abbeysof/public_html/adi/cron/daily.php: Permission denied

I asked my web host for help, and this is the answer:

If you use cpanel to create it, it will fill in the path for you. Usually / home / username / public _html / etc

Can anyone suggest some tips?

+5
source share
5 answers

1: wget, wget PHP script , , PHP , , script.

wget -O - http://yourdomain.com/adi/cron/daily.php >/dev/null 2>&1

cron cPanel cron. , , .

2: -, , .

+19

, cpanel, :

  • daily.php, .
  • , .

!

+3

/usr/bin/php -q /home/yourCpanelUsername/public_html/filename.php

cpanels

/usr/local/bin/php -q /home/yourCpanelUsername/public_html/filename.php
+2

, /home/abbeysof/public_html/adi/cron/daily.php.

+1

Link can help you. https://www.inmotionhosting.com/support/edu/cpanel/how-to-run-a-cron-job

There is a difference if you use VPS and not shared hosting to provide a team. You may need to use user-agentit cPanel-Cronalong with your URL.   curl --user-agent cPanel-Cron http://example.com/cron.php

0
source

All Articles