villeit Posted July 7, 2009 Share Posted July 7, 2009 Hi, I am completely new to CakePHP and I have just finished the first tutorial of building the Blog website. It worked well under my CakePHP installation, however I realised that having this structure means I need a Cake framework for each app. Not so good on my dev machine. So I decided I am going to configure my standard CakePHP installation so I can use the same framework for multiple Cake applications. My current structure is as follows: /htdocs (My Apache DocumentRoot) /cakeroot (contains the CakePHP installation) /app /cake /vendors /Website1 (Not using Cake) /Blog (a renamed copy of the /app directory) /config /controllers /locale /models /plugins /tests /tmp /vendors /views /webroot So if I understand things correctly, I am supposed to configure the 3 sections in /Blog/webroot/index.php as to get the application running from another directory path. Below is my configuration in this file: // The full path to the directory which holds "app", WITHOUT a trailing DS. if (!defined('ROOT')) { define('ROOT', 'htdocs'); } //The actual directory name for the "app". if (!defined('APP_DIR')) { define('APP_DIR', 'Blog'); } //The absolute path to the "cake" directory, WITHOUT a trailing DS. if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', 'htdocs'.DS.'cakeroot'); } But my problem is that when I try to access "http://localhost/Blog" I get a blank page! The current /cakeroot/app directory contains the same application as the Blog directory and that one works fine on my browser as "http://localhost/cakeroot" (I configured the routing to make the URL neater) What am I missing? ??? Quote Link to comment https://forums.phpfreaks.com/topic/165030-solved-problems-with-advanced-cakephp-configuration/ Share on other sites More sharing options...
jcombs_31 Posted July 7, 2009 Share Posted July 7, 2009 http://www.davidgolding.net/screencast-movies/2_installing_cake_outside_root_960_600.mov That video should explain it pretty well. You should consider moving both cake and app outside of your webroot, at least in a production system. Quote Link to comment https://forums.phpfreaks.com/topic/165030-solved-problems-with-advanced-cakephp-configuration/#findComment-870360 Share on other sites More sharing options...
villeit Posted July 7, 2009 Author Share Posted July 7, 2009 Thanks. The video clarified a couple of things for me and I got it working. But the main reason was that in Windows, you have to add the absolute paths to the ROOT directory and the CAKE_CORE_INCLUDE_PATH. So the correct way to point these where (in my case): if (!defined('ROOT')) { define('ROOT', 'C:'.DS.'Program Files'.DS.'Apache Software Foundation'.DS.'Apache2.2'.DS.'htdocs'); } /** * The actual directory name for the "app". */ if (!defined('APP_DIR')) { define('APP_DIR', 'Posts'); } /** * The absolute path to the "cake" directory, WITHOUT a trailing DS. */ if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', 'C:'.DS.'Program Files'.DS.'Apache Software Foundation'.DS.'Apache2.2'.DS.'htdocs'.DS.'cakeroot'); } Quote Link to comment https://forums.phpfreaks.com/topic/165030-solved-problems-with-advanced-cakephp-configuration/#findComment-870457 Share on other sites More sharing options...
jcombs_31 Posted July 7, 2009 Share Posted July 7, 2009 You should be able to append to the ROOT for the core include path instead of typing the whole thing out again. . Quote Link to comment https://forums.phpfreaks.com/topic/165030-solved-problems-with-advanced-cakephp-configuration/#findComment-870587 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.