<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: FasterHost</title>
    <description>The latest articles on DEV Community by FasterHost (fasterhost).</description>
    <link>https://dev.to/fasterhost</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F15694%2F02c21ce9-7207-4da9-a135-6766ac4ab7c3.png</url>
      <title>DEV Community: FasterHost</title>
      <link>https://dev.to/fasterhost</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fasterhost"/>
    <language>en</language>
    <item>
      <title>How to Set Up a Cron Job in cPanel (and Run WP-Cron and Laravel's Scheduler Properly)</title>
      <dc:creator>Fasterhost</dc:creator>
      <pubDate>Fri, 30 Oct 2026 09:20:56 +0000</pubDate>
      <link>https://dev.to/fasterhost/how-to-set-up-a-cron-job-in-cpanel-and-run-wp-cron-and-laravels-scheduler-properly-4j9l</link>
      <guid>https://dev.to/fasterhost/how-to-set-up-a-cron-job-in-cpanel-and-run-wp-cron-and-laravels-scheduler-properly-4j9l</guid>
      <description>&lt;p&gt;&lt;em&gt;First published in the &lt;a href="https://www.fasterhost.in/kb/set-up-a-cron-job-in-cpanel.php" rel="noopener noreferrer"&gt;FasterHost knowledge base&lt;/a&gt;. FasterHost is an Indian web host; the steps use cPanel's standard Cron Jobs page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A cron job runs a command on a schedule: process a mail queue every five minutes, clear old files at night, run Laravel's scheduler, or replace WordPress's visitor-triggered cron with a real one. On a cPanel account you add one from a form, without editing a crontab by hand.&lt;/p&gt;

&lt;p&gt;When a cron job "doesn't run", it has usually run and failed. Cron starts in your home directory with a minimal environment, not the one your shell has, and most of what follows is about not tripping over that.&lt;/p&gt;

&lt;h2&gt;
  
  
  The schedule: five fields
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌──────────── minute        (0–59)
│ ┌────────── hour          (0–23)
│ │ ┌──────── day of month  (1–31)
│ │ │ ┌────── month         (1–12)
│ │ │ │ ┌──── day of week   (0–6, 0 = Sunday)
│ │ │ │ │
*/5 * * * *   command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;*&lt;/code&gt; means "every" and &lt;code&gt;*/5&lt;/code&gt; means "every fifth". Ready to copy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*/5 * * * *    every 5 minutes
*/15 * * * *   every 15 minutes
0 * * * *      every hour, on the hour
30 2 * * *     every day at 2:30 am, server time
0 6 * * 1      every Monday at 6 am
0 0 1 * *      at midnight on the 1st of each month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cron runs on the &lt;strong&gt;server's&lt;/strong&gt; clock, which may not be your time zone. Run &lt;code&gt;date&lt;/code&gt; in a terminal on the server before you schedule anything for a particular hour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the job in cPanel
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open Cron Jobs.&lt;/strong&gt; In cPanel, go to &lt;strong&gt;Advanced → Cron Jobs&lt;/strong&gt;. The &lt;strong&gt;Cron Email&lt;/strong&gt; box at the top is where the output of every job is sent. Clear it to stop all of those emails, or silence jobs one at a time (step 4).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose when it runs.&lt;/strong&gt; Under &lt;strong&gt;Add New Cron Job&lt;/strong&gt;, pick a schedule from &lt;strong&gt;Common Settings&lt;/strong&gt;, for example &lt;strong&gt;Once Per Five Minutes&lt;/strong&gt;. It fills in the five fields for you: Minute, Hour, Day, Month and Weekday. You can also type them yourself from the list above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write the command with full paths.&lt;/strong&gt; Spell every path out. To run a PHP script (replace &lt;code&gt;cpuser&lt;/code&gt; with your cPanel username):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   /usr/local/bin/php /home/cpuser/public_html/cron.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To call a URL instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://example.in/tasks/run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the exact command in a terminal first (cPanel's &lt;strong&gt;Advanced → Terminal&lt;/strong&gt;, or SSH; both need shell access, which not every hosting plan includes). If it fails there, it will fail in cron, where you can't see the error.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Silence it or keep a log.&lt;/strong&gt; Each run's output is emailed to the Cron Email address, which adds up quickly for a job that runs every five minutes. Append this to discard it:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or append it to a log file you can read later. Create the &lt;code&gt;logs&lt;/code&gt; folder first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   /usr/local/bin/php /home/cpuser/public_html/cron.php &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /home/cpuser/logs/cron.log 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add it and check it ran.&lt;/strong&gt; Click &lt;strong&gt;Add New Cron Job&lt;/strong&gt;. It appears under &lt;strong&gt;Current Cron Jobs&lt;/strong&gt;, where you can edit or delete it. After the next scheduled time, read the log file or the email.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Leave enough time between runs for the job to finish. The server starts the next run on schedule even if the last one is still going.&lt;/p&gt;

&lt;h2&gt;
  
  
  One character to escape: &lt;code&gt;%&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;In a crontab line, cron turns an unescaped &lt;code&gt;%&lt;/code&gt; into a newline and hands everything after it to the command as input (&lt;a href="https://man7.org/linux/man-pages/man5/crontab.5.html" rel="noopener noreferrer"&gt;crontab(5)&lt;/a&gt;). So a command that works in your terminal, such as one that names its log file after the date, gets cut short under cron. Put a backslash before each &lt;code&gt;%&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/usr/local/bin/php /home/cpuser/public_html/cron.php &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /home/cpuser/logs/cron-&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +&lt;span class="se"&gt;\%&lt;/span&gt;F&lt;span class="si"&gt;)&lt;/span&gt;.log 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real cron for WordPress
&lt;/h2&gt;

&lt;p&gt;WordPress runs its scheduled tasks only when someone visits the site. On a quiet site a scheduled post can go out late; on a busy one the check runs far more often than it needs to. Turn the visitor trigger off in &lt;code&gt;wp-config.php&lt;/code&gt;, above the line that says to stop editing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nb"&gt;define&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'DISABLE_WP_CRON'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add a cron job every five minutes (&lt;code&gt;*/5 * * * *&lt;/code&gt;), changing the folder if WordPress isn't in &lt;code&gt;public_html&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /home/cpuser/public_html &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; /usr/local/bin/php wp-cron.php &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do both. With &lt;code&gt;DISABLE_WP_CRON&lt;/code&gt; set and no cron job behind it, nothing runs WordPress's scheduled tasks at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel's scheduler
&lt;/h2&gt;

&lt;p&gt;Laravel expects its scheduler to be called every minute, so the schedule is &lt;code&gt;* * * * *&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /home/cpuser/app &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; /usr/local/bin/php artisan schedule:run &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your tasks keep their own frequencies inside the app; this one cron entry wakes the scheduler, and Laravel runs whichever tasks are due.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why is my cron job not running?&lt;/strong&gt; Most often a path problem: cron starts in your home directory with a minimal environment, so use full paths to PHP and to the script. Run the exact command in a terminal first, and read the job's email or log for the error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which time zone does cron use?&lt;/strong&gt; The server's clock. &lt;code&gt;date&lt;/code&gt; shows it; adjust the hour if it differs from yours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I stop cron job emails?&lt;/strong&gt; Clear the Cron Email address to stop all of them, or end a single job's command with &lt;code&gt;&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>cron</category>
      <category>php</category>
      <category>laravel</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>How to Redirect a Domain or Page in cPanel (and Why the Redirect Does Nothing on WordPress)</title>
      <dc:creator>Fasterhost</dc:creator>
      <pubDate>Thu, 29 Oct 2026 09:05:11 +0000</pubDate>
      <link>https://dev.to/fasterhost/how-to-redirect-a-domain-or-page-in-cpanel-and-why-the-redirect-does-nothing-on-wordpress-2o4f</link>
      <guid>https://dev.to/fasterhost/how-to-redirect-a-domain-or-page-in-cpanel-and-why-the-redirect-does-nothing-on-wordpress-2o4f</guid>
      <description>&lt;p&gt;&lt;em&gt;First published in the &lt;a href="https://www.fasterhost.in/kb/redirect-a-domain-in-cpanel.php" rel="noopener noreferrer"&gt;FasterHost knowledge base&lt;/a&gt;. FasterHost is an Indian web host; the steps use cPanel's standard Redirects page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A redirect sends visitors, and search engines, from an old address to a new one: a page moved, the site changed domains, or a second domain should land on the main site. With a permanent (301) redirect, search engines pass the old address's ranking to the new one. cPanel sets one up from a single form. The catch comes on WordPress sites, where a redirect you added in cPanel can do nothing at all, and the reason is the order of the rules in &lt;code&gt;.htaccess&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting it up
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open Redirects.&lt;/strong&gt; In cPanel, go to &lt;strong&gt;Domains → Redirects&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose the type.&lt;/strong&gt; &lt;em&gt;Permanent (301)&lt;/em&gt; for a move you will not undo: a renamed page, a new domain, two sites merged into one. &lt;em&gt;Temporary (302)&lt;/em&gt; only when the original address will come back, such as a page taken down during a sale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose what to redirect.&lt;/strong&gt; Select the domain from the list, or &lt;strong&gt;All Public Domains&lt;/strong&gt; for every domain on the account. In the &lt;code&gt;/&lt;/code&gt; box, type the rest of the old address, for example &lt;code&gt;old-page.html&lt;/code&gt;. Leave it empty to redirect the whole domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enter the destination and the options.&lt;/strong&gt; In &lt;em&gt;Redirects to&lt;/em&gt;, type the full new address including &lt;code&gt;https://&lt;/code&gt;; cPanel requires the protocol. Under &lt;em&gt;&lt;a href="http://www" rel="noopener noreferrer"&gt;www&lt;/a&gt;. redirection&lt;/em&gt;, &lt;strong&gt;Redirect with or without www.&lt;/strong&gt; suits almost every site. When you move a whole domain, tick &lt;strong&gt;Wild Card Redirect&lt;/strong&gt;: it sends each page to the same path on the new domain, so &lt;code&gt;old.in/about&lt;/code&gt; lands on &lt;code&gt;new.in/about&lt;/code&gt; rather than on the home page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add it and test it.&lt;/strong&gt; Click &lt;strong&gt;Add&lt;/strong&gt;, then open the old address in a private browser window. To see exactly what the server answers:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://example.in/old-page.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a &lt;code&gt;301&lt;/code&gt; status and a &lt;code&gt;Location&lt;/code&gt; header with the new address.&lt;/p&gt;

&lt;p&gt;One quirk: a redirect cannot be edited in place. To change one, delete it from the list and add it again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Redirects that do nothing on WordPress
&lt;/h2&gt;

&lt;p&gt;You add the redirect, test the old URL, and get WordPress's own page instead, often a 404. The redirect is there; it just never runs.&lt;/p&gt;

&lt;p&gt;cPanel writes its redirect rules at the &lt;strong&gt;bottom&lt;/strong&gt; of the site's &lt;code&gt;.htaccess&lt;/code&gt; file, below WordPress's own rules. WordPress's block (its &lt;a href="https://developer.wordpress.org/advanced-administration/server/web-server/httpd/" rel="noopener noreferrer"&gt;standard &lt;code&gt;.htaccess&lt;/code&gt;&lt;/a&gt;) ends by handing every address that isn't a real file or folder, which on WordPress means every post and page, to &lt;code&gt;index.php&lt;/code&gt;. So WordPress catches the request first and the rules underneath never get a turn. A current WordPress install writes the block like this (its comment lines left out):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="c"&gt;# BEGIN WordPress&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;IfModule&lt;/span&gt;&lt;span class="sr"&gt; mod_rewrite.c&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="nc"&gt;RewriteEngine&lt;/span&gt; &lt;span class="ss"&gt;On&lt;/span&gt;
&lt;span class="nc"&gt;RewriteRule&lt;/span&gt; .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
&lt;span class="nc"&gt;RewriteBase&lt;/span&gt; /
&lt;span class="nc"&gt;RewriteRule&lt;/span&gt; ^index\.php$ - [L]
&lt;span class="nc"&gt;RewriteCond&lt;/span&gt; %{REQUEST_FILENAME} !-f
&lt;span class="nc"&gt;RewriteCond&lt;/span&gt; %{REQUEST_FILENAME} !-d
&lt;span class="nc"&gt;RewriteRule&lt;/span&gt; . /index.php [L]
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;IfModule&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="c"&gt;# END WordPress&lt;/span&gt;

&lt;span class="c"&gt;# ...the redirect lines cPanel added end up down here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The fix:&lt;/strong&gt; open &lt;code&gt;.htaccess&lt;/code&gt; in File Manager (switch on hidden files in its Settings; &lt;a href="https://www.fasterhost.in/kb/use-the-cpanel-file-manager.php" rel="noopener noreferrer"&gt;this File Manager guide&lt;/a&gt; shows where) and move the lines cPanel added, the ones naming your old address, &lt;strong&gt;above&lt;/strong&gt; the line &lt;code&gt;# BEGIN WordPress&lt;/code&gt;. Then run the &lt;code&gt;curl -I&lt;/code&gt; check again.&lt;/p&gt;

&lt;p&gt;If you have many redirects, manage them inside WordPress instead, with a plugin such as Redirection. That avoids editing &lt;code&gt;.htaccess&lt;/code&gt; by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving a whole site to a new domain
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Redirect every page to its equivalent with a wildcard 301, not everything to the home page.&lt;/li&gt;
&lt;li&gt;Keep the old domain registered and redirecting for at least a year; &lt;a href="https://developers.google.com/search/docs/crawling-indexing/site-move-with-url-changes" rel="noopener noreferrer"&gt;Google's advice&lt;/a&gt; is to keep redirects for as long as you can.&lt;/li&gt;
&lt;li&gt;Tell Google with the &lt;strong&gt;Change of Address&lt;/strong&gt; tool in Search Console, and update your own internal links to the new domain.&lt;/li&gt;
&lt;li&gt;HTTP to HTTPS is a different job, and not one for the Redirects page: switch on &lt;strong&gt;Force HTTPS Redirect&lt;/strong&gt; for the domain under &lt;strong&gt;Domains&lt;/strong&gt;. It covers every page of the domain at once.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick answers
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;301 or 302?&lt;/strong&gt; 301 for anything permanent: a moved page, a new domain, a merged site. Search engines then index the new address in place of the old one. Use 302 only when the original address will come back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I redirect a whole domain to another domain?&lt;/strong&gt; In &lt;strong&gt;Domains → Redirects&lt;/strong&gt;: Permanent (301), select the old domain, leave the path empty, enter the new domain with &lt;code&gt;https://&lt;/code&gt;, choose &lt;em&gt;Redirect with or without www.&lt;/em&gt; and tick &lt;em&gt;Wild Card Redirect&lt;/em&gt; so each page goes to the same path on the new domain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I edit a redirect?&lt;/strong&gt; You can't change one in place. Delete it from the list and add it again with the new values.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>cpanel</category>
      <category>apache</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
