CakePHP的控制台上的Godaddy主机 [英] CakePHP Console on Godaddy Hosting
问题描述
我一直在努力让我的CakePHP的网站上的帐户Godaddy的托管网格的工作。我的饼的应用程序是安装程序从该帐户的子目录托管,并且可以通过一个子域进行访问。我不得不调整我的.htaccess文件中得到这个工作,现在我需要获得CakePHP的控制台在这种环境下工作。
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.
我这是在亚马逊的EC2服务托管在Ubuntu服务器上的同一个蛋糕应用程序设置。基本上一个普通的开箱即用的Ubuntu LAMP设置的。 CakePHP的控制台按预期工作在这种环境。
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.
当我尝试运行Godaddy的控制台我得到以下信息:
When I try to run the console on Godaddy I get the following message:
CakePHP的控制台:此文件已加载错误,不能continue.Please确保/蛋糕/控制台是在你的系统路径,并检查手册此命令的正确用法(HTTP://manual.cakephp .ORG /)
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.(http://manual.cakephp.org/)
我已经开始在蛋糕/控制台/ cake.php一些调试code增加,找出发生了什么事情。在GoDaddy的网站,当我回声出的print_r($这个 - >参数)
在行183,我觉得数组为空。当我做这在我的Ubuntu EC2实例我得到这样的:
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 print_r($this->args)
at line 183 I find the array is empty. When I do this on my Ubuntu EC2 instance I get this:
阵列
(
[0] => /var/www/www.directory.sdcweb.org/htdocs/cake/console/cake.php
)
它看起来像GoDaddy的命令行PHP没有穿过的bash shell命令行参数。没有任何人有一些建议,我怎么可能会得到CakePHP的控制台上工作的Godaddy?
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?
它调用的蛋糕外壳的bash脚本包含以下
The bash script which invokes the Cake shell contains the following
LIB=${0/%cake/}
APP=`pwd`
exec php -q ${LIB}cake.php -working "${APP}" "$@"
exit;
我想,修改此脚本可能会解决问题。
I am thinking that modifying this script may solve the problem.
推荐答案
我不认为在lib任何编辑/饼是好的,因为它会与你的第一个蛋糕更新消失。
I don't think editing anything in the lib/cake is okay, since it will be gone with your first cake update.
相反,我改变了从php.ini中的 register_argc_argv
设置中加入一行:
Rather, I changed the register_argc_argv
setting from the php.ini by adding the line:
register_argc_argv=On
一切似乎现在和我一起工作。
All seems to work now with me.
这篇关于CakePHP的控制台上的Godaddy主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!