PostHow to bake on Ubuntu using cakePHP

Today I started a new project that I’m developing for school and I thought I’d do it using cakePHP.

I went ahead and downloaded xampp for linux and a fresh copy of the cakePHP framework, 1.3.0-RC3, and I extracted it to my webroot. After I created a virtual host for it, it was time to get baking. I tried using the console but it seemed that I wasn’t done installing the framework just yet.

Under Ubuntu you need to install cakephp-scripts using this command:

sudo apt-get install cakephp-scripts

otherwise you will get an error similar to this one

./cake: line 30: exec: php: not found

After you’ve installed the cakephp-scripts, it’s time to update your system path to include the cake script. I did this using the gedit editor under Ubuntu. So, open a terminal and type:

sudo gedit /etc/environment &

and you should see the PATH variable like this

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:"

We must update the PATH as follows

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/lampp/bin:/opt/lampp/htdocs/cakephp/cake/console"

As you can see, the paths are separated by ‘:’. You should replace the paths as are those on your system. Save the file and exit gedit.
After you’ve done this, you should be able to run cake from you console like this

in-sanity@in-sanity-laptop:~$ cake
 
Welcome to CakePHP v1.2.3.8166 Console
---------------------------------------------------------------
Current Paths:
 -app: in-sanity
 -working: /home/in-sanity
 -root: /home
 -core: /usr/share/php
 
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:
 
 CORE/console/libs:
	 acl
	 api
	 bake
	 console
	 i18n
	 schema
	 testsuite
 
To run a command, type 'cake shell_name [args]'
To get help on a specific command, type 'cake shell_name help'

Success. Happy baking.




Related posts

I Disclose

Stay Connected

Subscribe to RSS Feed

Subscribe to RSS Feed

Follow me on Twitter

Follow me on Twitter

Subscribe via e-mail

Subscribe via e-mail

Comments 5 Responses to “How to bake on Ubuntu using cakePHP”

  1. Great tutorial. Any suggestions on good books for getting started with CakePHP? I’ve done a little web development but never worked with a MVC framework before.

    Thanks.

  2. Hi,

    The best place to start is the CakePHP official documentation. Thanks for your appreciation.

  3. you just made today more awesome. thank you.

  4. I feel good too. Thanks. ;)

  5. [...] the original post: Insanityville – How to bake on Ubuntu using cakePHP – Reviews … If you enjoyed this article please consider sharing [...]


Post your comment

Leave a Reply