Tuesday, September 7, 2021

Set Up Virtual Host for cakephp

Open the httpd-vhosts.conf file from the C:/xampp/apacheconf/extra in order to set up new virtual host that can run your CakePHP application. You will have to add the following lines in order to run the application:

<strong>NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot C:/xampp/htdocs/jack
ServerName local.jack.com

<Directory “C:/xampp/htdocs/jack”>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost></strong>

<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>```

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.jack.com as the server name, and likewise, we will have to add it to the C:/Windows/System32/drivers/etchosts file as mentioned below:

# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
127.0.0.1 local.jack.com
# ::1 localhost

If your web server is already running, restart it so that you can access the new CakePHP installation by growing to http://local.jack.com through your browser.


Link : https://www.cometchat.com/blog/setup-cakephp-using-xampp-on-windows

 

How to install cakephp on local wamp server?

 1. Download updated Cake PHP from CakePHP Official Website[^] and unzip the file.

2. Copy the folder to Wamp server folder : C:\www\wamp\(cakefolder)
3. Here everything you will have to do in app folder. Don't alter any other folder content, if you don't have much knowledge.
4. Go to (cakefolder) -> app -> Config -> database.php.defult and rename it as database.php
5. Open (cakefoler) -> app -> Config -> core.php and change the Security.salt value and Security.cipherSeed.
6. Make sure the (cakefolder) -> tmp is writable and apache mod_rewrite is enabled.
7. Set the database.php configuration with the database details.
8. Open the browser and type : http://localhost/(cakefolder)/ and that's up.