vaanipala
vaanipala

Reputation: 1291

cakephp: fatal error: can't find core.php when configuring cakephp on shared webhost justhost.com

i've uploaded my website (to justhost.com) as per the instructions in Installation for Production server and Advanced Installation in the cakephp cookbook. I've also followed the guidance given in my previous post cakephp: configuring cakephp on shared host justhost. I've moved the config folder from app to webroot. However, i'm still getting :

Warning: include(/home/aquinto1/public_html/merryflowers.com/config/core.php) 

[function.include]: failed to open stream: No such file or directory in /home/aquinto1/cake/libs/configure.php on line 400

Warning: include() [function.include]: Failed opening '/home/aquinto1/public_html/merryflowers.com/config/core.php' for inclusion (include_path='/home/aquinto1:/home/aquinto1/public_html/merryflowers.com/:.:/usr/lib/php:/usr/local/lib/php') in /home/aquinto1/cake/libs/configure.php on line 400

Fatal error: Can't find application core file. Please create /home/aquinto1/public_html/merryflowers.com/config/core.php, and make sure it is readable by PHP. in /home/aquinto1/cake/libs/configure.php on line 401

Can someone point out on what mistake i'm making. Thank you.

Upvotes: 0

Views: 5477

Answers (2)

vaanipala
vaanipala

Reputation: 1291

As dhofstet said, i had put only the contents of webroot in /public_html/merryflowers.com/.

I have edited index.php in /public_html/merryflowers.com/ as follows:

/**
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
 *
 */

if (!defined('ROOT')) {
    define('ROOT', DS.'home'.DS.'aquinto1');  
    //define('ROOT', dirname(dirname(dirname(__FILE__))));
}
/**
 * The actual directory name for the "app".
 *
 */
if (!defined('APP_DIR')) {
    define('APP_DIR','app');
    //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);
    define('CAKE_CORE_INCLUDE_PATH', DS.'home'.DS.'aquinto1');

}

The static pages of the website is displaying now! :)

Scott Harwell, i'm using cakephp 1.3.

Thank you all for the guidance. You guys are just amazing! :)

Upvotes: 0

Scott Harwell
Scott Harwell

Reputation: 7465

If you move the Cake folder at all, then you have up update web root/index.php and tell it where to find the lib directory. These steps are a little different between 1.3 and 2.0+, so I am assuming 2.0 here.

Open webroot/index.php and find define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');. Uncomment it and change ROOT . DS . 'lib' to the path of the lib folder under webroot. It would probably look like this:

define('CAKE_CORE_INCLUDE_PATH', dirname(__FILE__) . DS . 'lib');

This tells cake to look for the lib folder in app/webroot.

This all said, don't put the lib folder in web root because that would be web accessible. Put it in the app folder instead and make sure that the include path points to the right dir.

Upvotes: 1

Related Questions