简体   繁体   English

Cake php 缺少助手,在本地工作但不在远程工作

[英]Cake php Missing helper, working on local but not on remote

Faced this issue and none of the solutions mentioned online actually helped: Using Cake php all my project was working perfectly fine on a local windows machine but not working on a linux server and I was presented with this error:面对这个问题,网上提到的所有解决方案都没有实际帮助:使用 Cake php 我的所有项目在本地 Windows 机器上都运行良好,但在 linux 服务器上无法运行,并且出现了以下错误:

Missing Helper
Error: HTMLHelper could not be found.

Error: Create the class HTMLHelper below in file: app/View/Helper/HTMLHelper.php

<?php
class HTMLHelper extends AppHelper {

}

Eventually I found out that I wasn't missing any helpers but the issue was in the ctp file and the different ways Linux and Windows read that file.最终我发现我没有遗漏任何帮助程序,但问题在于 ctp 文件以及 Linux 和 Windows 读取该文件的不同方式。 I will write the answer below我会在下面写答案

The way this was solved was by changing these:解决这个问题的方法是改变这些:

$this->HTML->script
$this->html->script

to this:对此:

$this->Html->script

I have a same problem and still with erros.我有同样的问题,仍然有错误。 In my case i nedded to change就我而言,我需要改变

$this->form to $this->Form $this->form$this->Form

$this->url to $this->Url $this->url$this->Url

and some elements was named with error.并且某些元素的命名有误。

Linux is case sensitive and some methods needs named like Cake docs, even windows works Linux 区分大小写,一些方法需要命名为 Cake docs,甚至 Windows 也能工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM