Appearance
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:
| Task | What It Does | Why It Matters |
|---|---|---|
| License verification | Checks your license status every 72 hours | Keeps your store running without interruption |
| Scheduled commands | Runs any registered scheduled tasks | Ensures automation works correctly |
| Queue processing | Processes background jobs | Emails, 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
- Log in to cPanel
- 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:
| Field | Value |
|---|---|
| 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>&1Replace 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
- Open cPanel > File Manager
- Navigate to your Shop Craft directory (the folder that contains the
artisanfile) - Look at the path shown in the breadcrumb bar at the top
The path will look something like:
/home/yourusername/public_htmlor:
/home/yourusername/public_html/shopcraftMethod 2: Check cPanel Account Info
- In cPanel, look for Server Information or Stats on the sidebar
- Find the Home Directory entry
- Your site is typically at
{home directory}/public_htmlor a subdirectory within it
Method 3: Use the Terminal (If Available)
If your cPanel has a Terminal option:
- Open cPanel > Terminal
- Navigate to your site directory and type
pwd - 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:
- Wait a few minutes after setting up the cron job
- Check the
storage/logs/laravel.logfile for recent scheduler entries - 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>&1Common PHP paths on shared hosting:
| Path | PHP Version |
|---|---|
/usr/local/bin/php | Default PHP |
/usr/local/bin/php81 | PHP 8.1 |
/usr/local/bin/php82 | PHP 8.2 |
/usr/local/bin/php83 | PHP 8.3 |
/opt/cpanel/ea-php81/root/usr/bin/php | cPanel PHP 8.1 |
/opt/cpanel/ea-php82/root/usr/bin/php | cPanel 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
artisanfile - Check that the
artisanfile has execute permission (it should by default) - Check
storage/logs/laravel.logfor 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.