11

I am using CakePHP 2.4.7 and I'm trying to execute CakePHP shell on remote host.

I'm connecting to server as root and then executing $ [path_to_my_foler]/app/Console/cake

The output is: -bash: [path_to_my_foler]/app/Console/cake: Permission denied

How could it be? How to fix it?

Alexander
  • 959
  • 5
  • 11
  • 29
  • What's the output of `ls -l [path_to_my_foler]/app/Console/cake`? – Marek Sep 09 '14 at 07:57
  • Marek, the output is: `-rw-r--r-- 1 root root 1383 Apr 4 18:25 [path_to_my_folder]/app/Console/cake` – Alexander Sep 09 '14 at 08:14
  • 2
    Make sure the file is executable (-x). Also, always run the console relative from your APP dir. So do "cd app" first, then "Console/cake". – mark Sep 09 '14 at 08:14
  • I typed `$ [path_to_my_foler]/app` and then `Console/cake`. Got `Permission denied`. Then i tryed to type `Console/cake -x` and also got `Permission denied`. – Alexander Sep 10 '14 at 11:34
  • 2
    I'll expand @mark comment, first `cd` to `[path_to_my_foler]/app`, next use `chmod +x Console/cake` to make it executable, and then `Console/cake` – waldek_h Sep 13 '14 at 08:01
  • Thanks for the correction of the typo :) – mark Sep 13 '14 at 13:31

2 Answers2

33

Did you get this solve? I think this could do the trick. (Running the command from your app directory

 chmod +x Console/cake
antoniovassell
  • 1,012
  • 14
  • 24
8

In CakePHP Version 3 and above this is the right command.

chmod +x bin/cake

This is CakePHP documentation for reference.

Console

The cake executable has been moved from the app/Console directory to the bin directory within the application skeleton. You can now invoke CakePHP’s console with bin/cake.

Documentation link

Community
  • 1
  • 1
Ariful Haque
  • 3,662
  • 5
  • 37
  • 59