Skip to content

Cron / Scheduler Setup

Setting up a cron job allows Shop Craft to run background tasks automatically. While your store will work without it, a cron job is strongly recommended for reliable operation.

Why Do You Need a Cron Job?

Shop Craft uses a task scheduler to handle several important background operations:

TaskWhat It DoesWhy It Matters
License verificationChecks your license status every 72 hoursKeeps your store running without interruption
Scheduled commandsRuns any registered scheduled tasksEnsures automation works correctly
Queue processingProcesses background jobsEmails, notifications, and other async tasks

What Happens Without a Cron Job?

Without a cron job, background tasks will not run automatically. The most important consequence is that license verification will not happen on schedule, which means your store could eventually enter the grace period and show license warnings in the admin panel.

Setting Up the Cron Job in cPanel

Step 1: Open Cron Jobs

  1. Log in to cPanel
  2. Find and click Cron Jobs (it is usually in the Advanced section)

Step 2: Set the Schedule

Under Add New Cron Job, set the frequency to Once Per Minute by using these values:

FieldValue
Minute*
Hour*
Day*
Month*
Weekday*

Use the Quick Preset

Most cPanel interfaces have a Common Settings dropdown at the top. If you see the option Once Per Minute (* * * * *), just select it instead of filling in each field manually.

Step 3: Enter the Command

In the Command field, enter:

bash
cd /home/yourusername/public_html && php artisan schedule:run >> /dev/null 2>&1

Replace the Path

You must replace /home/yourusername/public_html with the actual path to your Shop Craft installation directory. See How to Find Your Site Path below.

Step 4: Save

Click Add New Cron Job to save.

That's it! The cron job will now run every minute and execute any scheduled tasks.

How to Find Your Site Path

Not sure what path to use in the cron command? Here are a few ways to find it:

Method 1: cPanel File Manager

  1. Open cPanel > File Manager
  2. Navigate to your Shop Craft directory (the folder that contains the artisan file)
  3. Look at the path shown in the breadcrumb bar at the top

The path will look something like:

/home/yourusername/public_html

or:

/home/yourusername/public_html/shopcraft

Method 2: Check cPanel Account Info

  1. In cPanel, look for Server Information or Stats on the sidebar
  2. Find the Home Directory entry
  3. Your site is typically at {home directory}/public_html or a subdirectory within it

Method 3: Use the Terminal (If Available)

If your cPanel has a Terminal option:

  1. Open cPanel > Terminal
  2. Navigate to your site directory and type pwd
  3. The output is your full path

Verifying the Cron Job Works

After setting up the cron job, you can verify it is running by checking the cron job list in cPanel. The job should appear under Current Cron Jobs.

To further verify that the scheduler is running correctly:

  1. Wait a few minutes after setting up the cron job
  2. Check the storage/logs/laravel.log file for recent scheduler entries
  3. In the admin panel, check that the license status shows as Active (not in a grace period)

Troubleshooting

"Command not found: php"

Some hosting providers require the full path to PHP. Try replacing php with the full path:

bash
cd /home/yourusername/public_html && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

Common PHP paths on shared hosting:

PathPHP Version
/usr/local/bin/phpDefault PHP
/usr/local/bin/php81PHP 8.1
/usr/local/bin/php82PHP 8.2
/usr/local/bin/php83PHP 8.3
/opt/cpanel/ea-php81/root/usr/bin/phpcPanel PHP 8.1
/opt/cpanel/ea-php82/root/usr/bin/phpcPanel PHP 8.2

Ask Your Host

If none of the paths above work, contact your hosting provider and ask them: "What is the full path to PHP 8.1+ on my server?" They will give you the correct path.

Cron job runs but nothing happens

  • Verify that the path in the command is correct and points to the directory containing the artisan file
  • Check that the artisan file has execute permission (it should by default)
  • Check storage/logs/laravel.log for any error messages

"Permission denied" errors

Make sure the storage/ directory and its subdirectories are writable (755 or 775). See File Permissions.

Hosting does not support cron jobs

Some very basic hosting plans may not include cron job support. In this case:

  • Upgrade to a plan that supports cron jobs (most standard shared hosting plans do)
  • Use an external cron service (like cron-job.org) to make a request to your site at regular intervals
  • Contact your hosting provider to ask about alternatives

Frequency Matters

While the recommended frequency is once per minute, the scheduler is smart enough to know which tasks to run and when. Running it every minute does not mean every task runs every minute — tasks have their own schedules (like license verification every 72 hours). The one-minute interval just ensures tasks run promptly when they are due.

Shop Craft Documentation