LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2010, 06:19 AM   #1
izzo
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Rep: Reputation: 0
Cannot approach the cakephp console


Hi guys,

I have made a cronjob, but it wont run, after some research i find out that my red hat does not see the cake console file.

When i type the command in the terminal i get the following:
root@mydomain:/var/www/domains/mydomain/cake/console# cake
-bash: cake: command not found

I searched here and on google what the problem could be and it seems that the $PATH is not set like it should, but i dont know how to fix it.

When i am in the console directory and echo $PATH, i get following:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Is there something wrong with the path?

Can someone please help, i am already 5 hours busy with trying to fix this.
 
Old 08-13-2010, 06:23 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
You could export PATH variable and include the cake command location there.
like

export PATH=$PATH:/path/to/cake
 
Old 08-13-2010, 06:29 AM   #3
izzo
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Chaitanya,

Thank you for the quick answer!

So if i run this code:
export PATH=$PATH:/var/www/domains/mydomain/cake/console

It will save the path, and i could run it from the console and it will work from the cronjob as well?
 
Old 08-16-2010, 02:19 AM   #4
izzo
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Original Poster
Rep: Reputation: 0
does not work

if i do the following
export PATH=$PATH:/var/www/domains/mydomain/cake/console
and i try to run cake it still tells me command not found.

Can anyone help me?
 
Old 08-16-2010, 02:27 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Are you sure cake is a command? Can you give more information? From the location, I suppose it has something do with your website.
 
Old 08-16-2010, 02:33 AM   #6
izzo
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Cake is a command. And is needed to run cronjobs. Cake has two runable files in that directory: cake.bat(for windows) and cake(for linux).

From the cronjob i need to run this line:
/var/www/domains/mydomain/cake/console/cake cronjobs

I am now a couple of days trying to fix this
 
Old 08-16-2010, 03:39 AM   #7
izzo
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I fixed it by giving rights to the cake file.

chmod 777 cake
 
Old 08-16-2010, 04:03 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
No. Do not make it world writable. chmod +x is better way of making it executable.
 
Old 08-17-2010, 01:58 AM   #9
izzo
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Original Poster
Rep: Reputation: 0
You are righ Chaitanya! Thank you!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Scanning files with ClamAV from CakePHP LXer Syndicated Linux News 0 07-06-2009 10:00 PM
LXer: Working with Simple Associations using CakePHP LXer Syndicated Linux News 0 12-19-2008 01:40 AM
LXer: Cook up Web sites fast with CakePHP: Adding cache LXer Syndicated Linux News 0 01-23-2007 12:54 AM
LXer: Cook up Web sites fast with CakePHP, Part 2: Bake bigger and better LXer Syndicated Linux News 0 12-15-2006 07:03 PM
LXer: Cook up Web sites fast with CakePHP, Part 1 LXer Syndicated Linux News 0 11-28-2006 01:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration