Can Any Body Suggest me how to bake the cake in CakePHP 2.x on linux
What I have tried
$ cd MyProject/app/Console
$ ./cake bake
it give me this line, don't know how to proceed from here
Welcome to CakePHP v2.1.3 Console
---------------------------------------------------------------
App : Console
Path: /var/www/MyProject/app/Console/
---------------------------------------------------------------
What is the path to the project you want to bake?
[/var/www/MyProject/app/Console/myapp] >
You're in the wrong path
When you do this:
$ cd /MyProject/app/Console
$ ./cake bake
You're launching the cake cli from inside the Console folder. That's not the right/normal way to execute the cake cli.
As is evident from the output, the cli thinks that you want to bake a new project in the Console folder because the path you are in, is not itself already a project. This changed some months ago, but in the version of cake you're using, the directory you are in, is assumed to be your app folder.
That said, ordinarily cake is used like this:
$ cd /MyProject/app
$ Console/cake bake
Welcome to CakePHP v2.3.6 Console
---------------------------------------------------------------
App : app
Path /var/www/project/app/
---------------------------------------------------------------
Interactive Bake Shell
---------------------------------------------------------------
[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[F]ixture
[T]est case
[Q]uit
What would you like to Bake? (D/M/V/C/P/F/T/Q)
When already in an app folder - the bake command asks you what you want to create.
Related
I'm experiencing a trouble with cakephp console and bluehost. Some months ago I configure permissions on 'Console/cake' folder and I could access to console without problems. Now I'm not able to access. I'm in the 'Console' folder and I run
$ ./ cake
but I receive this message :
$ No such file or directory
All permissions are set to 755. I tried also to set permissions to 777 but the result is the same. Have you any idea ? Thx in advance
[EDIT]
I SOLVED --> Cakephp Cake command returns No such file or directory
I am getting this error when I try to run a CakePHP 2.1 Shell from a cron job:
/bin/sh: /home/[other-folders]/lib/Cake/Console/cake: Permission denied
This is the code I've been using for almost a year with CakePHP 1.3.7 and it worked well. What could the problem be? I've checked the permissions on the cake file, and it is 755, just like the cake file I had in 1.3.7. Thanks!
Are all the directories in the path set to at least +x for the user executing the cron job? If you can't at least execute the directories above cake, you won't be able to execute the program.
Make sure the file path you set in cron is executable:
ls -l /path/to/project/folder/file
chmod +x /path/to/project/folder/file
ls -l /path/to/project/folder/file
So, latest permission will be like -rwxr-xr-x. and things will be working for you. , This solution not only applied to cake but any file you set in cron.
Thats it! Cheers!!
I'm using Hostgator.com and I'm trying to bake apps via ssh console. I have connected successfully to via SSH. I have the cakephp folder located at http://www.domainname.com/cakephp
the initial cakephp installation is working fine. Connected to database etc.
This is a list of paths from Hostgator: List
here is my .bash_profile:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PS1="$ "
alias www="cd /home/username/public_html"
export PATH="/usr/bin/php/bin:/home/username/public_html/cakephp/cake/console:$PATH:$HOME/bin"
When i open terminal I do this: www [enter] -> cake bake [enter]
then I get this problem: -jailshell: /home/username/public_html/cakephp/cake/console/cake: Permission denied
if anyone could help me it would be greatly appreciated. If I have forgot to mention something please tell me asap so I can tell you.
You need to set the executable flag on the cake script.
www
chmod +x cakephp/cake/console/cake
How to cake bake in Linux environment - Cakephp?
I download the latest version from cakephp website. created some tables and trying to bake process but its not working. I try to run cake bake inside cake/console but nothing happens
but in windows we need to set the environment variables like that any settings need for LINUX..
Thanks in advance
First, make sure the script is executable:
cd cake/console
chmod +x cake
Second, make sure that you have the php5-cli installed. The process for this varies by system. Googling "php5-cli" + your distribution name should get you the information.
Third, you don't need to add cake to your path as long as you don't mind navigating to the folder or typing in the full path.
cd cake/console/
./cake bake
export PATH=$PATH:/path/to/your/cakeSiteDir/lib/Cake/Console
cd /path/to/your/cakeSiteDir
cake bake
Worked finally for me and did not close my console with cakephp 2.x
how to open & use cakephp i18n console ????s
What operating system are you using?
In Linux, open your shell and navigate to the app directory of the application you're working on. If everything is correctly configured, you just run $ cake i18n and follow the instructions. If it's not, you need to run cake.php with the PHP executable $ /usr/bin/php -q -f ../cake/libs/console/cake.php i18n.
It's the same in windows, just the paths and executable name are different. It looks like C:\www\project\app> c:\php\bin\php.exe -q -f c:\www\project\cake\libs\console\cake.php i18n.