问题
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