Apache

Start your first CakePHP Project with Zend Server on Windows

Posted on Updated on

  1. Visit CakePHP website
  2. Download the CakePHP Framework
  3. You must have setup a local webserver. If not, install Zend Server Community Edition and MySQL. Download Zend server and install it. If you are not installing MySQL as separate installation you can choose it with Zend server installation also. You can install it separately, do this as you wish.
  4. Create a database called “cakephp”.
  5. Go to Zend Server web root it will be “C:\Program Files\Zend\Apache2\htdocs”.
  6. Extract CakePHP Framework to your web root and re name with the version (Eg. cake_1_3 or cakephp, here I used cakephp).
    Your CakePHP project folder Structure will be as follows,
    /cakephp 

    • /app
    • /cake
    • /vendors
    • /.htaccess
    • /index.php
    • /README
  7. Open database.php on the cakephp app/config directory, and set host, login, password and save the work.
  8. Open core.php on the same directory and change Security.salt and Security.cipherSeed values for different (for tests, simply put additional character at the end).
  9. Now open “C:\Windows\System32\drivers\etc\hosts” file in a notepad and add following at the end,
    127.0.0.2    cakephp
  10. Open Apache2 configuration file (httpd.conf) at “C:\Program Files\Zend\Apache2\conf” and add the following virtual host.
    <VirtualHost 127.0.0.2>
    ServerName cakephp
    DocumentRoot “C:\Program Files\Zend\Apache2\htdocs\cakephp\app\webroot”
    <Directory “C:\Program Files\Zend\Apache2\htdocs\cakephp\app\webroot”>
    AllowOverride all
    Options All
    </Directory>
    </VirtualHost> 

  11. Copy “cake” folder from your cakephp folder and paste it in “C:\Program Files\Zend\ZendServer\share”.
  12. Open Environmental Variables and change the “path” and add “C:\Program Files\Zend\ZendServer\share\cake\console” at the end of the paths.
  13. Save all changes and RESTART windows.
  14. Access http://cakephp on your browser. It should work.
  15. Now start developing, app folder is the folder you need to work.
  16. Open Command Prompt and change the directory to your cake app drirectory, use following
    cd C:\Program Files\Zend\Apache2\htdocs\cakephp\app
  17. Press Enter and enter command cake
  18. You should get as follows,
    cakephp 1.3.6 on windows
  19. Now you can bake your cake..
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.C:\Users\Administrator>cd C:\Program Files\Zend\Apache2\htdocs\cakephp\appC:\Program Files\Zend\Apache2\htdocs\cakephp\app>cake 


Welcome to CakePHP v1.3.6 Console
—————————————————————
Current Paths:
-app: app
-working: C:\Program Files\Zend\Apache2\htdocs\cakephp\app
-root: C:\Program Files\Zend\Apache2\htdocs\cakephp
-core: C:\Program Files\Zend\ZendServer\share

Changing Paths:
your working path should be the same as your application path
to change your path use the ‘-app’ param.
Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells:
acl [CORE]                              i18n [CORE]

api [CORE]                              schema [CORE]

bake [CORE]                             testsuite [CORE]

console [CORE]

To run a command, type ‘cake shell_name [args]’
To get help on a specific command, type ‘cake shell_name help’

C:\Program Files\Zend\Apache2\htdocs\cakephp\app>

Advertisements

Configure Apache/MySQL/PHP on Windows

Posted on Updated on

For novice only, I remember I found this article three years back. We must be thankful for Dr. Robert Kline for the generous contribution of this article for its’  timely updates. This online guide is the most updated wamp configuration guide. I have written a easy guide for Ubuntu. This is the best guide for windows. Read it.

Configure Apache MySQL PHP (LAMP) on Ubuntu 12.04

Posted on Updated on

There are many ways to do this but I’ll share the best and the  a easiest way to configure Apache MySQL and PHP (LAMP) on your Ubuntu. this is for Ubuntu 11.04

1. Go to applications->accessories->terminal

2. Enter Following commands accordingly,

sudo apt-get install tasksel

sudo tasksel install lamp-server

3. Give the MySQL root password, that’s all

4.  We want the default site to be /home/YourUserName/sites/. To do this, we must create a new site and then enable it in Apache2.

To create a new site:

Create a new folder called sites in /home/YourUserName

Copy the default website as a starting point.

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite

5. gksudo gedit /etc/apache2/sites-available/mysite

6. Change the DocumentRoot and Directory to point to the new location. For example replace /var/www/ it with /home/YourUserName/sites/.

Now changes should be as follows,

……..
DocumentRoot /home/YourUserName/sites

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/YourUserName/sites/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
…..

7. Change the Directory directive, replace to

sudo a2dissite default && sudo a2ensite mysite

8. Finally, we restart Apache2:

sudo /etc/init.d/apache2 restart

9. Click here http://localhost/

10. So It Works!