Setup of cakephp in windows

Source: Internet
Author: User
In Windows, how does one configure CakePHP project book.cakephp.org2.0zhinstallationadvanced-installation.html? This url is very clear, but the following description uses linux as an example. in win, pay attention to the following: the core class library CakePHP is located in the libCake directory. Cakephp settings in windows

Http://book.cakephp.org/2.0/zh/installation/advanced-installation.html

?

This url is very clear, but the following is an example of linux. in win, pay attention to the following:

Write


The core CakePHP class library is located in the/lib/Cake directory.
Application code, which is located in the/app Directory.
The webroot of an application is usually located in the/app/webroot directory.

There are three constants to be modified: ROOT, APP_DIR, and CAKE_CORE_INCLUDE_PATH.

ROOT should be set to the directory path containing your app folder.
APP_DIR should be set to the directory name of the app directory ).
CAKE_CORE_INCLUDE_PATH should be set to the Directory of the CakePHP class library.

?

For example?

Write

If (! Defined ('root ')){
Define ('root', dirname (_ FILE __))));
}

?

This means that the root path is the parent folder of this file.

?

In actual cases, my index. php is

C: \ USBWebserverv8.5 \ root \ myRootCakephp/index. php

The setting means that the parent folder is used.

?

Write

If (! Defined ('root ')){
Define ('root', dirname (_ FILE __)));
}

?

At the same time, my app and cake are stored in

C: \ USBWebserverv8.5 \ root \ cakephp \ app

C: \ USBWebserverv8.5 \ root \ cakephp \ lib

?

Write

If (! Defined ('app _ dir ')){
Define ('app _ dir', DS. 'cakephp'. DS. 'app ');
}

Define ('Cake _ CORE_INCLUDE_PATH ', ROOT. DS. 'cakephp'. DS. 'Lib ');

?

Why does the app and lib in the same path add root and none during setup?

?

After root is added to the app

Warning: Include (C: \ USBWebserverv8.5 \ root \ C: \ USBWebserverv8.5 \ root \ cakephp \ app \ Config \ core. php) [function. include]: failed to open stream: Invalid argument inC: \ USBWebserverv8.5 \ root \ cakephp \ lib \ Cake \ Core \ Configure. php? On line?72

?

There are two drive letters (drive letters) in it. you can only remove them.

?

If root is not added to lib

?

Warning: Include (\ cakephp \ lib \ Cake \ bootstrap. php) [function. include]: failed to open stream: No such file or directory in?C: \ USBWebserverv8.5 \ root \ myRootCakephp \ index. php? On line?97

?

It is directly recognized as a path similar to linux. Win naturally cannot recognize it

?

Therefore, the result of the callback can only be the same as above. of course, this also shows that root, lib, and app can be completely separated and fully comply with the instructions of cakephp. Linux may be easier.

?

?

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.