Tuesday, June 28, 2011

Shared Server - changing the paths

Hi All

Im just uploading a site to a shared server for the first time in
quite a while and I cant remember how to change the paths

Have read previously that you shouldnt keep your cake/ and app/
folders in the webroot, so have bumped them out. All files from the
webroot are now in my webroot folder

The dir structure I see through ftp is:
----------------------------
/
myusername/
www.mydomain.com/

the webroot is the www.mydomain.com/ folder
----------------------------

(fyi my username is skiclub, may make things clearer for errors below)

So I uploaded my cake & app files and webroot files
----------------------------
/
myusername/
cakephp/
app/
cake/
www.mydomain.com/
css/
img/
js/
index.php
etc....
----------------------------

Now im trying to edit my webroot index.php to get the appropriate
paths to the cake core and the app files, but nothing seems to be
working.

The original:
----------------------------
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
----------------------------

The edit I made (based on a tutorial I saw, although they set up their
dirs different to me)
----------------------------
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', 'skiclub' . 'cakephp' . DS . 'app');
}
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'skiclub' . DS .
'cakephp' . DS . 'cake');
}
----------------------------

The errors I got...
----------------------------
Warning: main(cake/bootstrap.php) [function.main]: failed to open
stream: No such file or directory in /home/skiclub/skiclub/
www.mydomain.com/index.php on line 76

Warning: main(cake/bootstrap.php) [function.main]: failed to open
stream: No such file or directory in /home/skiclub/skiclub/
www.mydomain.com/index.php on line 76

Warning: main(cake/bootstrap.php) [function.main]: failed to open
stream: No such file or directory in /home/skiclub/skiclub/
www.mydomain.com/index.php on line 76

Warning: main() [function.include]: Failed opening 'cake/
bootstrap.php' for inclusion (include_path='/home/skiclub/skiclub/
cakephp/cake:/home/skiclub/cakephp/app/:.:/usr/local/lib/php') in /
home/skiclub/skiclub/www.mydomain.com/index.php on line 76

Fatal error: CakePHP core could not be found. Check the value of
CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to
the directory containing your /cake core directory and your /vendors
root directory. in /home/skiclub/skiclub/www.mydomain.com/index.php on
line 77
--------------------------------------

One thing I noticed was the double up of my account name (skiclub)
eg: /home/skiclub/skiclub/www.mydomain.com/index.php so have tried
with and without extra 'skiclub' in the paths.

Im guessing that "Check the value of CAKE_CORE_INCLUDE_PATH in APP/
webroot/index.php" is just standard for basic cake installations (like
that on my dev server) as I dont have a webroot dir in my app folder -
do I need to change some path for that somewhere too?

For this part of the error:
----------------------------
(include_path='/home/skiclub/skiclub/cakephp/cake:/home/skiclub/
cakephp/app/:.:/usr/local/lib/php')
----------------------------

I dont really get it. The first part I think is my path to the
cakePHP core: /home/skiclub/skiclub/cakephp/cake
... but I dont get why it has the colon and the the path to the app
dir and the more colons etc and the path to some php thing? Any
clarity on that may help me figure this out?

Based on the above structure and errors, can anyone help me figure out
what the correct paths would be?

Oh, its all so complicated....

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: