CakePHP 2.0+ Setup on online shared hosting

时光总嘲笑我的痴心妄想 提交于 2019-12-07 19:44:28

问题


1 and I've uploaded all the files onto the file server that I am using 000webhost.com however Im having a few problems with the modrewrite I keep getting re-directed to http://error404.000webhost.com/? Does anyone know how to setup cakephp 2.1 on a shared area??

Im getting this error now: Fatal error: Call to undefined function pluginsplit() in /home/a4300629/public_html/lib/Cake/Cache/Cache.php on line 151 not really sure how this error has come about, any ideas?

Thanks in advance.


回答1:


Right I've figured it out, I followed the .htaccess instructions on this site. http://www.000webhost.com/forum/web-programming/29628-help-cake-php-install.html But firstly I deleted all the files and re-uploaded and this still didn't work until I used this .htaccess method.

Hope this helps anyone else who has this problem.




回答2:


After research on cakephp tutorial, which come to setting cakephp on shared hosting and it will work :)

  • move app, cake, plugins, vendors folder into your hosting root folder. It is user root folder on your hosting
  • delete .htaccess and index.php on cakephp root folder
  • move /app/webroot/. to /public_html folder
  • delete empty /app/webroot folder
  • edit /public_html/index.php to point to the ‘cake’ and ‘app’ directories. For example my public_html path for my domain is /home/username/public_html, so i point
  • ROOT to look at /home/username
  • APP_DIR to look at /home/username/app
  • CAKE_CORE_INCLUDE_PATH to look at /home/username/cake
  • edit this line on /public_html/index.php with your appropriate path

/** * The actual directory name for the "app". * Edited By Siraj */ if (!defined('APP_DIR')) { define('APP_DIR', basename(dirname(dirname(FILE))) . DS .'public_html' . DS .'app');

}

/// START --- Edited By Siraj

if (!defined('CAKE_CORE_INCLUDE_PATH')) { if (function_exists('ini_set')) { ini_set('include_path', '/home' . DS . 'username' . DS . 'public_html' . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path')); //define('CAKE_CORE_INCLUDE_PATH', 'home' . DS . 'username' . DS . 'public_html' . DS . 'lib'); } if (!include ('/home' . DS . 'username' . DS . 'public_html' . DS . 'lib' . DS .'Cake' . DS . 'bootstrap.php')) { $failed = true; } } else { if (!include ('/home' . DS . 'username' . DS . 'public_html' . DS . 'lib' . DS . 'Cake' . DS . 'bootstrap.php')) { $failed = true; } }

//// END

  • The only .htaccess i have on /home/username/public_html, the setting for .htaccess look like this

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



来源:https://stackoverflow.com/questions/11245391/cakephp-2-0-setup-on-online-shared-hosting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!