the0ther the0ther - 1 year ago 138
Linux Question

CakePHP Console on Godaddy Hosting

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.

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.

When I try to run the console on Godaddy I get the following message:

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

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
at line 183 I find the array is empty. When I do this on my Ubuntu EC2 instance I get this:

[0] => /var/www/

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?

The bash script which invokes the Cake shell contains the following


exec php -q ${LIB}cake.php -working "${APP}" "$@"


I am thinking that modifying this script may solve the problem.

Answer Source

I don't think editing anything in the lib/cake is okay, since it will be gone with your first cake update.

Rather, I changed the register_argc_argv setting from the php.ini by adding the line:


All seems to work now with me.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download