In this tutorial, I will be guiding you on how to set and run the CakePHP framework on Windows 7. For those who have not heard of CakePHP before, it is an open source web application framework for producing web applications. It is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License. More information can be found on their official website here.An online IT degree is what some people pursue when they want to learn more about computer software and security.
Before starting the tutorial, please check whether the prerequisite listed below has been completed.
- Web Server With PHP & mySQL (Recommended Xampp Or Wamp).
- 25 mb of free space — for the CakePHP files.
1. Visit the CakePHP download archive in GitHub here and download the latest stable version. Download the files .zip format since we will be setting it on Windows operating system.
2. Once the download completed, extract the files and copy the files into the web server www root. You should place the folder as shown in the image below. The folder’s name can be changed as you wished and doesn’t required to be named as cake in order to run it. Do not start the server yet , there are some configuration needed to be done on the Apache core files before running the CakePHP framework.
3. If you have installed a bundled web server like Xampp or Wamp, navigate to the Apache folder within your web server. On the other hand, if the installation was made separately, locate the Apache installation folder. Then, navigate to the conf folder which is located within the Apache main folder.
4. Next, open the httpd.conf file which is in the conf folder. Open it using notepad or any other text based editor. The file will display contents like shown in the image below.
5. Find the code below and uncomment it. This is to enable the rewrite module on the apache. By default it is turned off in some web servers. If it is already uncommented you can continue to the next step.
Locate this code and remove the ‘#’ which is located in front of the line.
#LoadModule rewrite_module modules/mod_rewrite.so
The modified code should look like this. Save and close the file, upon completing the modification
LoadModule rewrite_module modules/mod_rewrite.so
6. Now, start your server and visit the location of the folder via your preferred Internet Browser. Eg. http://localhost/cake/. By now, the default screen for CakePHP should be displayed like below.
Take note: Some of the information displayed on the CakePHP page will show error. You need to make changes in the CakePHP configuration files to fix it. I will try to cover this separately on another article.