Windows under CakePHP's set up each project

Source: Internet
Author: User
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.

?

?

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.