Godaddy主机上的CakePHP控制台 [英] CakePHP Console on Godaddy Hosting

查看:172
本文介绍了Godaddy主机上的CakePHP控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力让我的CakePHP网站工作在Godaddy的网格托管帐户。我的蛋糕应用程序设置是从帐户的子目录托管,可以通过子域访问。我不得不调整我的.htaccess文件来获得这个工作,现在我需要得到CakePHP控制台在这个环境中工作。



我有同样的蛋糕应用程序设置一个在Amazon的EC2服务上托管的Ubuntu服务器。基本上一个平装的Ubuntu LAMP安装程序。 CakePHP控制台在这个环境中正常工作。



当我尝试在Godaddy上运行控制台时,我收到以下消息:


CakePHP控制台:此文件已加载不正确,不能
继续。请确保/ cake / console位于系统
路径中,并检查手册以正确使用此
命令( http://manual.cakephp.org/ ) )


我已经开始在cake / console / cake.php中添加一些调试代码,以了解发生了什么。在godaddy网站上,当我在第183行回显 print_r($ this-> args)时,我发现数组为空。当我在我的Ubuntu EC2实例这样做时,我得到这个:

  Array 

[0] => /var/www/www.directory.sdcweb.org/htdocs/cake/console/cake.php

看起来像godaddy的命令行PHP不通过bash shell命令行参数。任何人都有一些建议,如何我可以得到CakePHP控制台上Godaddy工作。



调用Cake shell的bash脚本包含以下

  LIB = $ {0 /%cake /} 
APP =`pwd`

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

exit;

我认为修改此脚本可能会解决问题。


<我不认为编辑lib /蛋糕中的任何东西都是好的,因为它会随着你的第一次蛋糕更新而消失。



相反,我通过添加以下行来更改php.ini中的 register_argc_argv 设置:

  register_argc_argv = On 

所有似乎都与我现在工作。


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 command.(http://manual.cakephp.org/)

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:

Array
(
    [0] => /var/www/www.directory.sdcweb.org/htdocs/cake/console/cake.php
)

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

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.

解决方案

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:

register_argc_argv=On

All seems to work now with me.

这篇关于Godaddy主机上的CakePHP控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆