vighnesh
vighnesh

Reputation: 19

How to run php script on cron job in cpanel

I schedule a new job on cronjob. But it's not working. Is there any way to run cronjob in cpanel using commands.

Upvotes: 1

Views: 2948

Answers (4)

Liton Kumar
Liton Kumar

Reputation: 1

you can simply use like this - /usr/local/bin/ea-php74 /home/username/domainname.com/script_path/yourfile.php

replace username to your cpanel username, domain name to your domain name, script path where you want to run it, then replace the main file for corn job in yourfile.php

Upvotes: 0

user7346035
user7346035

Reputation: 451

Run it in putty

          • /usr/bin/php /var/www/html/project_name/artisan schedule:run 1>> /dev/null 2>&1 this is for laravel project

Upvotes: 0

Shoaib Quraishi
Shoaib Quraishi

Reputation: 258

Go to CRON JOB option on your cpanle menus Set url like this and set time according to your functionality

php /home/username/public_html/filename.php

Upvotes: 0

Code Cooker
Code Cooker

Reputation: 937

There is a bunch of way to running script with CRON. I do use this way on my web application most of the time when I need to use CRON.

The first step is to choose a setting. The setting means when you want to run this script.

and after then simply just use CURL with Cron to get this work properly like this: curl http://example.com/script.php on command box and click on the add button and whola! You have successfully added your first CRON Task.

You may have a look at this picture below to get it properly Example uses Image

Upvotes: 2

Related Questions