Step 1: Download XAMPP and CakePHP.
Step 2: Install Xampp
Once you have installed Xampp (version 1.7.3) on your Windows with the default option, all your files will be located in the C:\xampp folder.Step 3: Mod Rewrite Module
Once Xampp is installed as the local server, you can then proceed to enable mod_rewrite. To do so, you will have to open the httpd.conf file that is located in C:\xampp\apache\conf and uncomment by removing # from the following line:# LoadModule rewrite_module modules/mod_rewrite.so
Step 4: Place CakePHP Files in a New Folder
Extract the CakePHP (version 1.3.8) zip file and copy all its contents to your local web server, which in this instance is C:\xampp\htdocs\cakephp. I have decided to name the CakePHP folder as cakephp, and in it, you will find many files and folders for the framework, including app, cake, docs, vendors, .htaccess, and index.php.Step 5: Set Up Virtual Host
Open the httpd-vhosts.conf file from the C:\xampp\apache\conf\extra in order to set up new virtual host that can run your CakePHP application. You will have to add the following lines in bold font, in order to run the application:NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot C:/xampp/htdocs/
cakephp ServerName local.
cakephp.com <Directory “C:/xampp/htdocs/
cakephp”> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot C:/xampp/htdocs/xampp ServerName localhost <Directory “C:/xampp/htdocs/xampp”> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
Code Snippet 1: The httpd-vhosts.conf file will have the aforementioned configuration for virtual host to run CakePHP and other php application.I have decided to choose ‘local.cakephp.com’ as the server name, and likewise, we will have to add it to the
C:\Windows\System32\drivers\etc\hosts file as mentioned below:
If your web server is already running, restart it so that you can access the new CakePHP installation by growing to http://local.cakephp.com through your browser.# localhost name resolution is handled within DNS itself. 127.0.0.1 localhost 127.0.0.1 local.
cakephp.com # ::1 localhost
Step 6: Setting Up Database Connection
Start off setting up your database connection by renaming the database configuration file to database.php file from database.php.default file, as found in the C:\xampp\htdocs\razib\app\config folder. Now open the database.php file and enter a username, password, and database name to the ‘$default’ connection variable:var $default = array ( ‘driver’ => ‘mysql’ , ‘persistent’ => false ‘host’ => ‘localhost’ , ‘login’ => ‘root’ , ‘password’ => ‘ ‘ , ‘database’ => ‘
cakephp’ , ‘prefix’ => ‘ ‘ , );
you rocking!! how easy its..steps are good
ReplyDeleteThanks :-)
ReplyDeletehi aftre the configution my apache run with error: Apache shutdown unexpectedly This may be due to a blocked port, missing dependencies,
ReplyDelete