CakePHP 2.0+在线共享主机设置

时间:2012-06-28 13:09:29

标签: cakephp mod-rewrite web-hosting

1我已经将所有文件上传到我使用的文件服务器000webhost.com但是我对modrewrite有一些问题我一直被重定向到http://error404.000webhost.com/? 有谁知道如何在共享区域设置cakephp 2.1?

我现在收到此错误:Fatal error: Call to undefined function pluginsplit() in /home/a4300629/public_html/lib/Cake/Cache/Cache.php on line 151不确定这个错误是怎么发生的,有什么想法吗?

提前致谢。

2 个答案:

答案 0 :(得分:2)

对,我已经弄清楚了,我按照本网站上的.htaccess说明进行操作。 http://www.000webhost.com/forum/web-programming/29628-help-cake-php-install.html 但首先我删除了所有文件并重新上传,直到我使用这个.htaccess方法后仍然无效。

希望这可以帮助其他有此问题的人。

答案 1 :(得分:1)

经过对cakephp教程的研究,在共享主机上设置cakephp,它将起作用:)

  • 将app,cake,plugins,vendors文件夹移动到您的托管根目录中 夹。它是您托管的用户根文件夹
  • 删除cakephp根文件夹上的.htaccess和index.php
  • 将/ app / webroot / 移至/ public_html文件夹
  • 删除empty / app / webroot文件夹
  • 编辑/public_html/index.php指向'蛋糕'和'应用' 目录。例如,我的域的public_html路径是 / home / username / public_html,所以我指出
  • ROOT查看/ home / username
  • APP_DIR查看/ home / username / app
  • CAKE_CORE_INCLUDE_PATH查看/ home / username / cake
  • 使用适当的路径在/public_html/index.php上编辑此行
  

/ **   *“app”的实际目录名称。   *由Siraj编辑   * / if(!defined('APP_DIR')){define('APP_DIR',basename(dirname(dirname( FILE )))。DS。'public_html'.DS。'app');

     

}

     

/// START ---由Siraj编辑

     

if(!defined('CAKE_CORE_INCLUDE_PATH')){if   (function_exists('ini_set')){ini_set('include_path','/ home'。DS。   '用户名' 。 DS。 'public_html'。 DS。 'lib'。 PATH_SEPARATOR。   ini_get( '的include_path')); // define('CAKE_CORE_INCLUDE_PATH','home'。   DS。 '用户名' 。 DS。 'public_html'。 DS。 'LIB'); if(!include   ('/ home'。DS。'用户名'。DS。'public_html'。DS。'lib'。DS   。'蛋糕' 。 DS。 'bootstrap.php')){$ failed = true; }} else {if   (!include('/ home'。DS。'username'。DS。'public_html'。DS。'lib'   。 DS。 '蛋糕' 。 DS。 'bootstrap.php')){$ failed = true; }}

     

////结束

  • 唯一.htaccess我有/ home / username / public_html,设置 .htaccess看起来像这样
  

RewriteEngine On RewriteCond   %{REQUEST_FILENAME}!-d RewriteCond%{REQUEST_FILENAME}!-f   RewriteRule ^(。*)$ index.php?url = $ 1 [QSA,L]