CakePHP configuration method (Go)
Transferred from: http://blog.csdn.net/wjazz/archive/2008/07/06/2618750.aspx
?
After studying the day cakephp, finally put cakephp installed successfully, and now share with you my installation experience, I hope it is a bit of use for everyone
?
One: Download cakephp
Download the latest cakephp to: http://cakeforge.org/projects/cakephp/(Stable version)
can also go to: https://svn.cakephp.org/repo/trunk/cake/1.x.x.x/(SVN version)
I am using the cake_1.1.19 version, you can go to: http://download.csdn.net/source/521486 download
?
II: Cake directory structure
/app???
??? /config????????? -Configuration file directory, including database, ACL, etc.???
??? /controllers???? -Controllers file????????
??????? /components-components file???
??? /index.php?????? -Allows you to deploy the app directory as a documentroot (see Apache related configuration)???
??? /models????????? -Model file????
??? /plugins???????? -Plugins file???
??? /tmp???????????? -Cache and log storage????
??? /vendors???????? -The third-party class library used in your app???
??? /views????????? -View File???????
??????? /elements??? -View element file???????
??????? /errors????? -Custom Error page???????
??????? /helpers???? -Helpers file???????
??????? /layouts???? -Page layout file???????
??????? /pages?????? -Static paging file???
??? /webroot???????? -Web root directory???????
??????? /CSS???????
??????? /files???????
??????? /IMG??????
??????? /js
/cake??????????????? -Core class library, please do not arbitrarily modify any files, unless you are sure that you have the ability
index.php??????????
/vendors???????????? -third-party class libraries on the server side
III: CakePHP Installation
?
CakePHP is installed in three ways: Development mode, production mode, free installation. For the first two types of installation online There are many articles have been said to be very detailed and very clear, I am not here, I am mainly talking about the free installation method. From the directory structure analysis, cake mainly has a three files, the app, cake, Webroot, my installation method is to open three directories, first in the disk directory to create a cakephp folder, and then in the inside of the Myroot, MyApp, Mycake three folders and then copy all the files in the Webroot file in the extracted file into the Myroot folder, then copy the app folder to the MyApp folder and copy the cake and vendors two folders to the Mycake folder. , then the current file directory results are as follows
?
?
/cakephp
??? /myroot
??????????? /css
??????????? /files
??????????? /img
??????????? /js
??????????? . htaccess
??????????? css.php
??????????? Favicon.ico
??????????? index.php
??? /myapp
??????? /app
??????????? /config
??????????? /controllers
??????????? /models
??????????? /plugins
??????????? /tmp
??????????? /vendors
??????????? /views
??????????? index.php
??? /mycake
??????? /cake
??????????????? /config
??????????????? /docs
??????????????? /libs
??????????????? /scripts
??????????????? app_controller.php
??????????????? app_model.php
??????????????? basics.php
?????????????? bootstrap.php
??????????????? dispatcher.php
??????? /vendors
?
The next step is to modify the myroot/index.php file as follows:
if (!defined (' ROOT ')) {
????????????? Define (' ROOT ', DS. ' CakePHP '. Ds. ' MyApp ');
?????? }
?????? if (!defined (' App_dir ')) {
????????????? Define (' App_dir ', ' APP ');
?????? }
?????? if (!defined (' Cake_core_include_path ')) {
????????????? Define (' Cake_core_include_path ', DS. ' CakePHP '. Ds. ' Mycake ');
?????? }
?
This will be done after the modification.
?
Four: Apache Configuration
After setting up the above directory structure, we need to do some checking and configuration of Apache, which is also a problem that our novice often encounters. First ensure that the httpd.conf configuration file mod_rewrite is loaded, if not, find LoadModule rewrite_module modules/mod_rewrite.so to remove the previous #. In addition here is a question, I see other articles said there are addmodule mod_rewrite.c has not been found, do not know how to do, want to know can give me the next. Here httpd.conf to note, is the system http.conf not a single user or the configuration file of the site, in my common sense, I was set up a multi-site server, that is, registered a number of servers, For example, there is a cake.conf file, if you do not modify the file, it is not, so we still have to change the file. The following changes are in the same vein. The second place to check is that the configuration file
??? Options FollowSymLinks
??? AllowOverride All
??? Order Deny,allow
??? Deny from all
??? Satisfy All
This section
Check if allowoverride is all if not, please change all. Then save restart Apache.
One of the other articles mentioned is that you may get a cakephp copy without the necessary. htaccess file. Because some operating systems treat files that begin with. As hidden files, they are not copied. Make sure your cakephp copy is downloaded on our website or checkout on our SVN repository. (I didn't meet ^_^)
In addition to UNIX or Linux installation, if you install cake in a user directory (http://example.com/~myusername/), you need to modify the root directory of the. htaccess file, plus a line " Rewritebase/~myusername/".
?
V: Database Connection Configuration
In this installation, locate the Myapp/app/config/database.php.default file and copy the name to database.php. Then use the editor to open, the database connection inside the changes, see how to change, here I do not explain.
?
At last
?
Browse Address:
http://localhost/into CakePHP's welcome page and can now begin to experience cakephp's journey.
?
Thank you, in the next log, I will build a sample program blog to share experience, I hope that these experiences can bring help to everyone, but also hope that we can put the process of the mistakes I pointed out.
This article from Csdn Blog, reproduced please indicate the source: http://blog.csdn.net/wjazz/archive/2008/07/06/2618750.aspx