CakePHP: Permission denied error when trying to execute cake console command

I run both CakePHP 1.3 and 2.0 for my side projects and wanted to be able to use both console executables in my Ubuntu 11.10 dev box; I set up my aliases in my .bashrc file to point for:

Cake 1.3: alias cake=”<CAKE_FOLDER>/cake/console/cake”

Cake 2.1: alias cake2=”<CAKE_2_1_FOLDER>/app/Console/cake2″

and added the paths to the console folders where the scripts actually reside to my global PATH variable:

PATH=”<CAKE_FOLDER>/cake/console:$PATH”

PATH=”<CAKE_2_1_FOLDER>/app/Console:$PATH”

Since both Cake 1.3 and 2.1 console commands are called cake, i renamed the Cake 2 version to cake2 and gave it executable permissions:

mv cake cake2

chmod 755 cake2

So i tried running both command but kept getting a: “Permission Denied” error. I googled around and everybody else got their problem solved by either chmoding the cake script to either 755 or 777, or any of the containing folders in the script path. If you are running into this issue, first ensure that any folder in the path to the cake script has 755 permissions and that the cake script itself is 755. Mine was all halal but it was still no dice! I couldn’t execute and was still getting this permission denied issue. So i went back to Google and expanded my search outside the CakePHP fold and into permissions error in general when executing scripts and bang! I encountered a question on SO related to a similar issue that put me on the right track. My code resides on an extended partition that i mounted using the “users,user” option, and apparently doing it that way sets the “noexec” option as well which prevents the execution of binaries on the mounted partition. That was the source of my error, I edited my /etc/fstab file and added the “exec” option to the mount options. unmounted and remounted and bingo! I was in business. If you have exhausted all other possibilities, I bet this is what your issue is related to so give it a shot and make sure to comment for others if you come up with another solutions.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s