Windows under CakePHP settings for each project
Http://book.cakephp.org/2.0/zh/installation/advanced-installation.html
?
This URL is very clear, but the following instructions are described in Linux as an example, in win a little attention to the following
Wrote
CakePHP Core Class library, located in the/lib/cake directory.
The code for the application, located in the/app directory.
The Webroot of the application, usually located in the/app/webroot directory.
There are three constants that need to be modified: ROOT, App_dir, and Cake_core_include_path.
Root should be set to the directory path that contains your app folder.
App_dir should be set to the directory name of the app directory (that is, it does not contain the previous path).
Cake_core_include_path should be set as the path to the CakePHP class library directory.
?
Such as?
Wrote
if (!defined (' ROOT ')) {
Define (' ROOT ', DirName (DirName (dirname (__file__)));
}
?
means that the root path is the parent parent folder of this file
?
In fact, my index.php is
c:\usbwebserverv8.5\root\myrootcakephp/index.php
The setting is, that means the parent folder
?
Wrote
if (!defined (' ROOT ')) {
Define (' ROOT ', DirName (dirname (__file__)));
}
?
At the same time, my app and cake are on the
C:\USBWebserverv8.5\root\cakephp\app
C:\USBWebserverv8.5\root\cakephp\lib
?
Wrote
if (!defined (' App_dir ')) {
Define (' App_dir ', DS. ' CakePHP '. Ds. ' app ');
}
Define (' Cake_core_include_path ', ROOT. DS. ' CakePHP '. Ds. ' Lib ');
?
App and Lib under the same path, why set the time, one add root, one does not add?
?
When you add root to the app, it appears
Warning : Include (c:\usbwebserverv8.5\root\c:\usbwebserverv8.5\root\cakephp\app\config\core.php) [ Function.include]: Failed to open stream:invalid argumentinC:\USBWebserverv8.5\root\cakephp\lib\Cake\ core\configure.php? the
?
There are 2 C-drive characters, no way, only remove
?
And if there's no root on Lib,
?
Warning : Include (\cakephp\lib\cake\bootstrap.php) [function.include]: failed to open stream:no such file or direct Ory in? C:\USBWebserverv8.5\root\myRootCakephp\index.php ? on line? the
?
will be directly recognized as a Linux-like path. Win Nature can't recognize it
?
So, the transfer of the result, can only be the above appearance, of course, this also shows that Root,lib,app, can be completely separated, fully comply with CakePHP's instructions. Linux may be easier to spot.
?
?