{"id":915,"date":"2026-07-17T08:40:20","date_gmt":"2026-07-17T08:40:20","guid":{"rendered":"https:\/\/documentation.iqonic.design\/frezka-saas\/?p=915"},"modified":"2026-07-17T08:40:22","modified_gmt":"2026-07-17T08:40:22","slug":"how-to-setup-server-cron-job-for-laravel-frezka-saas","status":"publish","type":"post","link":"https:\/\/documentation.iqonic.design\/frezka-saas\/how-to-setup-server-cron-job-for-laravel-frezka-saas\/","title":{"rendered":"How to setup Server Cron Job for Laravel (Frezka SaaS)"},"content":{"rendered":"<div class=\"nolwrap\">\n<p>This guide provides step-by-step instructions to set up the required cron jobs on their server for Frezka SaaS (Laravel Task Scheduler).<\/p>\n\n\n\n<p>Frezka utilizes Laravel&#8217;s built-in scheduler to manage background processes such as:<\/p>\n\n\n\n<p>1. <strong>Google Calendar Syncing<\/strong> (runs every 5 minutes).<\/p>\n\n\n\n<p><strong>2. Background Queue Processing<\/strong> (processes emails, notifications, and heavy jobs).<\/p>\n\n\n\n<p>3. <strong>Subscription Checks<\/strong> (handles billing\/expiry).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Golden Rule of Laravel Scheduling<\/h2>\n\n\n\n<p>Instead of creating multiple cron entries for each task, Laravel requires you to set up only <strong>one<\/strong> single cron job on your server that runs every minute. This job executes the Laravel Scheduler, which then handles all sub-tasks automatically.<\/p>\n\n\n\n<p>The cron command looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* * * * * cd \/path-to-your-project &amp;&amp; php artisan schedule:run &gt;&gt; \/dev\/null 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Method 1: Setting up Cron Job via cPanel (Shared Hosting)<\/h2>\n\n\n\n<p>Most Envato clients host their websites on shared hosting using cPanel. Follow these steps to configure the cron job:<\/p>\n\n\n\n<p>1. Log in to your <strong>cPanel<\/strong>.<\/p>\n\n\n\n<p>2. Scroll down or search for the <strong>Advanced<\/strong> section, then click on <strong>Cron Jobs<\/strong>.<\/p>\n\n\n\n<p>3. Under the <strong>Add New Cron Job<\/strong> section:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Common Settings<\/strong>: Select <strong>Once Per Minute (* * * * *)<\/strong> from the dropdown. This automatically fills all time fields (Minute, Hour, Day, Month, Weekday) with asterisks <code>*<\/code>.<\/li>\n\n\n\n<li><strong>Command<\/strong>: Enter the command to run the scheduler. You must specify the full absolute path of your project.<br><code>bash cd \/home\/yourusername\/public_html &amp;&amp; php artisan schedule:run &gt;&gt; \/dev\/null 2&gt;&amp;1<\/code><br><em>(Be sure to replace <code>\/home\/yourusername\/public_html<\/code> with the actual path to your Frezka installation directory).<\/em><\/li>\n<\/ul>\n\n\n\n<p>4. Click <strong>Add New Cron Job<\/strong>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>[!TIP]<br><strong>Finding your PHP Path:<\/strong><br>On some shared hosting servers, using <code>php<\/code> directly in the command may invoke an outdated system PHP version instead of the version your project uses (e.g. PHP 8.2). If your cron job fails to run, find your server&#8217;s PHP binary path (usually shown on the cPanel homepage or via search) and prefix the command with it:<br><code>\/usr\/local\/bin\/ea-php82\/php-cli artisan schedule:run &gt;&gt; \/dev\/null 2&gt;&amp;1<\/code><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Method 2: Setting up Cron Job via SSH \/ Linux Terminal (VPS\/Dedicated Server)<\/h2>\n\n\n\n<p>If you are running the project on a VPS (like Ubuntu, CentOS, or Debian) with terminal access:<\/p>\n\n\n\n<p>1. Connect to your server via SSH.<\/p>\n\n\n\n<p>2. Open the crontab configuration file for the web server user (usually <code>www-data<\/code> or <code>nginx<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   sudo crontab -u www-data -e<\/code><\/pre>\n\n\n\n<p><em>(If running as a regular user, you can just run <code>crontab -e<\/code>).<\/em><\/p>\n\n\n\n<p>3. Add the following line at the very bottom of the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   * * * * * cd \/var\/www\/frezka-saas &amp;&amp; php artisan schedule:run &gt;&gt; \/dev\/null 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p><em>(Be sure to replace <code>\/var\/www\/frezka-saas<\/code> with your actual project directory).<\/em><\/p>\n\n\n\n<p>4. Save and exit the editor (for <code>nano<\/code>, press <code>Ctrl + O<\/code>, <code>Enter<\/code>, then <code>Ctrl + X<\/code>).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method 3: Cloud Panels (RunCloud, CyberPanel, aaPanel, Forge)<\/h2>\n\n\n\n<p>If you are using a modern cloud server control panel:<\/p>\n\n\n\n<p>1. Navigate to your Web App \/ Site settings.<\/p>\n\n\n\n<p>2. Find the <strong>Cron Jobs<\/strong> or <strong>Task Scheduler<\/strong> menu.<\/p>\n\n\n\n<p>3. Add a new cron job with the interval set to <strong>Every Minute<\/strong> (<code>* * * * *<\/code>).<\/p>\n\n\n\n<p>4. Set the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   php \/path-to-your-project\/artisan schedule:run<\/code><\/pre>\n\n\n\n<p>5. Choose the appropriate PHP version (e.g., PHP 8.2) in the panel dropdown if prompted.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Crucial Note: Queue Connection (<code>QUEUE_CONNECTION<\/code>)<\/h2>\n\n\n\n<p>If you set <code>QUEUE_CONNECTION=database<\/code> in your <code>.env<\/code> file (instead of <code>sync<\/code>), Laravel requires a background process to run the queue.<\/p>\n\n\n\n<p>Typically, this requires installing <strong>Supervisor<\/strong> on a VPS. However, since many users use shared hosting (where Supervisor is not available), <strong>Frezka SaaS<\/strong> has a built-in scheduler command in <code>app\/Console\/Kernel.php<\/code> that automatically executes and manages the queue worker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$schedule-&gt;command('queue:work --tries=3 --stop-when-empty')-&gt;withoutOverlapping();<\/code><\/pre>\n\n\n\n<p>Because of this built-in scheduler command, <strong>once you set up the single <code>schedule:run<\/code> cron job, it will automatically start and run the queue worker for you!<\/strong> No additional Supervisor installation is required on shared hosting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting Checklist<\/h2>\n\n\n\n<p><strong>1. PHP Version Mismatch:<\/strong> If your scheduler isn&#8217;t working, verify that your command line PHP version matches the web PHP version (Frezka requires PHP 8.1+ \/ 8.2+).<\/p>\n\n\n\n<p>2. <strong>File Permissions:<\/strong> Ensure the directory <code>\/path-to-your-project\/storage<\/code> and <code>\/path-to-your-project\/bootstrap\/cache<\/code> are writable by the cron process.<\/p>\n\n\n\n<p>3. <strong>Execution Output Logs:<\/strong> For debugging, instead of sending output to <code>\/dev\/null<\/code>, you can write it to a log file to see any errors:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   cd \/path-to-your-project &amp;&amp; php artisan schedule:run &gt;&gt; storage\/logs\/cron.log 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p>Check <code>storage\/logs\/cron.log<\/code> after a minute to see if the job ran successfully.<\/p>\n\n\n\n<p><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>This guide provides step-by-step instructions to set up the required cron jobs on their server for Frezka SaaS (Laravel Task Scheduler). Frezka utilizes Laravel&#8217;s built-in scheduler to manage background processes such as: 1. Google Calendar Syncing (runs every 5 minutes). 2. Background Queue Processing (processes emails, notifications, and heavy jobs). 3. Subscription Checks (handles billing\/expiry). [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":584,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-915","post","type-post","status-publish","format-standard","hentry","category-frezka-saas"],"featured_image_src":null,"author_info":{"display_name":"laraveladminiq","author_link":"https:\/\/documentation.iqonic.design\/frezka-saas\/author\/laraveladminiq\/"},"children":[],"_links":{"self":[{"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/posts\/915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/comments?post=915"}],"version-history":[{"count":1,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/posts\/915\/revisions"}],"predecessor-version":[{"id":916,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/posts\/915\/revisions\/916"}],"up":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/posts\/584"}],"wp:attachment":[{"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/media?parent=915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/categories?post=915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/frezka-saas\/wp-json\/wp\/v2\/tags?post=915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}