title: CakePHP Console on Godaddy Hosting
body: <p>I have been struggling to get my CakePHP site working on a Godaddy "grid hosting" account. My cake app is setup is hosted from a subdirectory on the account, and can be accessed via a subdomain. I had to adjust my .htaccess files to get this working, and now I need to get the CakePHP console working in this environment.</p>
  
  <p>I have the same cake application setup on an Ubuntu server which is hosted on Amazon's EC2 service. Basically a plain out of the box Ubuntu LAMP setup. The CakePHP console works as expected in this environment.</p>
  
  <p>When I try to run the console on Godaddy I get the following message:</p>
  
  <blockquote>
    <p>CakePHP Console: This file has been loaded incorrectly and cannot
    continue.Please make sure that /cake/console is in your system
    path,and check the manual for the correct usage of this
    command.(<a href="http://manual.cakephp.org/" rel="nofollow noreferrer">http://manual.cakephp.org/</a>)</p>
  </blockquote>
  
  <p>I've started to add in some debugging code in cake/console/cake.php to find out what's going on. On the godaddy site, when I echo out <code>print_r($this->args)</code> at line 183 I find the array is empty. When I do this on my Ubuntu EC2 instance I get this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; /var/www/www.directory.sdcweb.org/htdocs/cake/console/cake.php
  )
  </code></pre>
  
  <p>It looks like godaddy's command-line PHP isn't passing through the bash shell command line arguments. Does anybody have some advice as to how I might get the CakePHP console working on Godaddy?</p>
  
  <p>The bash script which invokes the Cake shell contains the following</p>
  
  <pre><code>LIB=${0/%cake/}
  APP=`pwd`
  
  exec php -q ${LIB}cake.php -working "${APP}" "$@"
  
  exit;
  </code></pre>
  
  <p>I am thinking that modifying this script may solve the problem.</p>