Open the browser and check the http: // localhost/phpinfo. php (remember to write the port number for non-default ports.
3. install and configure CakePHP
The so-called installation is actually decompression. Decompress CakePHP to D: \ cakephp first, then the directory structure extracted by CakePHP is like this:
From the various information on Google, there are about three configuration methods for Web applications, and the order of introduction has not changed. The second method is not to change the directory structure of CakePHP, but also to ensure security. I think it is good to use it.
Set the app/webroot directory under CakePHP to the DocumentRoot directory of Apache, open the rewrite module (remove the annotator), and change the AllowOverride attribute of the DocumentRoot directory to All. Modify the following content in the Apache configuration file:
< span> "D:/cakephp/app/webroot" >
AllowOverride All
...
Restart Apache again and access http: // localhost/. At this time, some information about CakePHP should be displayed.
If you use advanced configuration When configuring CakePHP, you may encounter the following warning on the page during trial run:
Warning (512): Cache not configured properly ....
Warning (2): array_merge () [function. array-merge]:...
Warning (2): array_merge () [function. array-merge]:...
I was really big when I encountered this problem. I checked the information for half a day and found that when I was almost desperate, I did not know where to see a piece of information, to grant the write permission to the tmp/cache/persistent directory in the APP. Check that the tmp directory does not exist, so you have created the cache/persistent directory. If you are in the Linux directory, you also need to grant the 777 permission to this directory.
4. install and configure MySQL
The installation of MySQL is also very simple. After the installation, there are some wizard configuration items. These are all database tasks. Follow the wizard step by step. The key is to allow PHP and CakePHP to use the MySQL database.
For the configuration in PHP, directly modify php. ini and remove the annotation symbol before extension = php_mysql.dll, that is
...
Extension = php_mysql.dll
...
Then put the phpinfo. copy php to the app/webroot of CakePHP and browse http: // localhost/phpinfo again. php: Check whether MySQL configuration information is available on the page. Because I did not do anything much-I was very depressed, and I was delayed for half a day.
There are a lot of DLL under the PHP5 directory, and directly copy these DLL files to the Apache bin directory (If your PHP5 directory is in the PATH, it may not be so troublesome ). Now let's take a look at the configuration information of MySQL on the page.
The configuration of CakePHP is in config/database. php under the app directory. Didn't you find this file? Is there a database. php. default? Just copy it and rename it database. php. Then, of course, you have to change something.
There is only one DATABASE_CONFIG class in this configuration. It has a $ default variable, which is saved as the configuration information of the default database. The configuration is similar to this:
Var $ default = array (
'Driver '=> 'mysql ',
'Persistent' => false,
'Host' => 'localhost ',
'Login' => 'your-username ',
'Password' => 'your-password ',
'Database' => 'your-database ',
'Prefix' => '',
);
Note that login, password, and database are configured according to the actual situation. After the configuration is complete, browse http: // localhost/. on this page, there should be a "Your database configuration file is present .". If your database is ready, you will see "Cake is able to connect to the database.". If you are not prepared, you may see some warning or error messages.
Summary
This configuration is really exhausting. Who is interested in creating a complete installation package? How nice is it to automatically configure it based on the installation location! Or a GUI or Web interface configuration program is also good.
<>