CakePHP's basic Environment

Source: Internet
Author: User
Tags name database

Here is the environment under the window to build, I assume php,apache,mysql, the basic environment are OK, if not, steal a lazy, with integrated environment, I use the wampserver.
1: Go to the official website (http://cakephp.org/) down a cakephp bag, unzip to get a folder, the directory structure is as follows:

2: Put these folders, files copy directly to Wampserver to provide us with the WWW folder

3: Let's go visit http://localhost:80/and look at it, the result might look like this:

4: Now go to configure it, find the Apache httpd.conf file Open
#LoadModule rewrite_module modules/mod_rewrite.so release this module.
5: Let's go visit http://localhost:80/and look at it, the result might look like this:

6: Next we change
Locate the core.php in the Config folder under the App folder and open the file to find these two lines:
Configure::write (' Security.salt ', ' dyhg93b0qyjfixfs2guvouubwwvnir2g0fgac9mi ');
Configure::write (' security.cipherseed ', ' 76859309657453542496749683645 ');
Get rid of the parameters of ' security.salt ' and ' security.cipherseed ', and change the characters randomly, such as
Configure::write (' Security.salt ', ' dyhg9tb0qyjfixfs2zxczzxczxcguvouubwwvnir2g0fgac9mi ');
Configure::write (' security.cipherseed ', ' 7685930965745354343242496749683645 ');
7: Then visit http://localhost:80/to see what the result might look like:

8: Next we go to cakephp database configuration, find this file database.php.default copy a change of name database.php
Open the database.php and find a place similar to the following.

classDatabase_config { Public $default=Array(        ' DataSource ' = ' database/mysql ', ' persistent 'false, ' host ' = ' localhost ', ' login ' = ' user ', ' password ' = ' password ', ' database ' =&gt ; ' database_name ', ' prefix ' = ', '//' encoding ' = ' UTF8 ',    );  Public $test=Array(        ' DataSource ' = ' database/mysql ', ' persistent 'false, ' host ' = ' localhost ', ' login ' = ' user ', ' password ' = ' password ', ' database ' =&gt ; ' Test_database_name ', ' prefix ' = ', '//' encoding ' = ' UTF8 ',    );}
View Code

Let's change $default this array, you should understand what's going on.
It's starting to change.

class Database_config {    public$defaultarray(        ' datasource ' = ') Database/mysql ',        false,        ' host ' = ' localhost ',        ' login ' = ' root ',        ' password ' = > ',        ' database ' = ' test ',        ' prefix ' = ', '        encoding ' = ' utf8 ', '    ;}
View Code

The reason for this change is that we are now going to the test database in the MySQL database provided by the local wampserver.
Restart the Wampserver service (remember to restart OH), and then visit http://localhost:80/:

9: This is basically green, our cakephp environment can be used. As for the following debugkit now we do not care about it, in fact, to install the Debug tool.
10: Here I use the cakephp library file address paste, do not want to go under the official website, with this also line (Http://pan.baidu.com/s/1mgjv0Ti)
and Debugkit's network address was posted (Http://pan.baidu.com/s/1qWNiRGK)
This is the most simple configuration, if you have not used, this is the introduction of cakephp, as for the use of the back to say

CakePHP's basic Environment

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.