title: Setting Up Laravel Scheduler on Production Server (Inmotion Hosting)
body: <p>I have come to realize that how you write the cron for the laravel scheduler varies from hosting to hosting so the docs are useless in this case.</p>
  
  <p>The same code I used on my previous host(siteground) does not seem to be working on my current one(inmotion).</p>
  
  <p>The cron that runs the scheduler, the one I set from my CPanel seems to work:</p>
  
  <pre><code>php -q /home/xxxxx/xxxxx/artisan schedule:run
  </code></pre>
  
  <p>I say it seems to work because I get this email whenever my cron runs:</p>
  
  <pre><code>Running scheduled command: /usr/bin/php -q /home/xxxxx/xxxxx/artisan {command} &gt; '/dev/null' 2&gt;&amp;1 &amp;
  </code></pre>
  
  <p>Now the above script does not seem to execute it just hangs and the processes pile up eating my memory until my entire server crashes.</p>
  
  <p>So I'm quite confused here, why does <code>php -q /home/xxxxx/xxxxx/artisan schedule:run</code> execute but somehow my app is unable to execute <code>/usr/bin/php -q /home/xxxxx/xxxxx/artisan {command}</code></p>
  
  <p>I googled it and several suggestions where to use <code>php-cli</code> instead of <code>php -q</code> but php-cli gives me a <code>command not found</code> error.</p>
  
  <p>So I asked support about this and this is what they said:</p>
  
  <blockquote>
    <p>I am not certain how you were able to run that command with another
    host, as php-cli is not a command for the php command line interface.
    Unfortunately, because this is not a valid command, I am not sure if I
    understand what you are trying to accomplish by running it. </p>
    
    <p>php -q is the option that executes php-cli, which is what you should
    be using for your crons; however it will only properly execute if the
    coding of the file that you are executing is correct.</p>
  </blockquote>
  
  <p>I have been on this for 2 days now, my question is how do I get my laravel scheduler to execute without any errors, does anyone have any experience with deploying a laravel(lumen) application on inmotion servers or similar? Thanks in advance. :)</p>