Trying to upload some files to a repo. It worked for the last repo that I did, but now for some reason it's not working. Please help! :) Thanks :)
$ git add .
error: open("AppData/Local/Google/Chrome/User Data/Default/Application Cache/Cache/data_0"): Permission denied
error: unable to index file AppData/Local/Google/Chrome/User Data/Default/Application Cache/Cache/data_0
fatal: adding files failed
You are probably out of a git repo: try to cd into you repo.
If you are really in the correct directory, you must change the chmod of your folder.
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
My sqlite db file is this: unable to open database file i chowned all folders until my dbfile to root. but i am still getting this error. but i remember that while creating my django project on server, i created a superuser, and now if i do ls -l i see that the user is that superuser. how is it possible to tell apache that this superuser should have that right to write/read the db file? or how to solve the problem, i am not apache/linux guru..
Execute chown www-data:www-data directory on the directory you want apache to be able to write to.
You should be able to just leave the file as owned by the super user and just change the group so that apache can read/write it as well.
Change the group for the sqlite file and the containing directory. Try this:
cd <directory with sqlite file>
sudo chgrp www-data . <sqlitefile>
You can find write group and www user and change permissions.
Say: cat /etc/passwd - for find right user, It may be apache or http or www.
And say to terminal: cat /etc/group -for find right group.
In my system group=apache, user = apache.
I am working on a CakePHP 2 project. It originally started out in 2.0.x and then recently migrated to 2.1.0. Throughout the whole development process, I have been receiving the error message below.
It pops up at the top of the page unpredictably. It can be when I am just viewing different pages, or even after I add a record to the database (yet the record properly saves).
Warning:
SplFileInfo::openFile(/var/www/cake_prj/app/tmp/cache/persistent/cake_core_cake_console_):
failed to open stream:
Permission denied in
/var/www/cake_prj/lib/Cake/Cache/Engine/FileEngine.php on line 293
I recursively set the owner and group of the tmp folder to apache, and still received the message. In addition, I then recursively set the permissions to read, write, and execute for all (chmod 777). The error message still pops up.
Even after changing both the owner, group, and permissions, the file in question:
cake_prj/app/tmp/cache/persistent/cake_core_cake_console_
will have its owner and group set back to root, and its permissions set back to default.
What could be causing this problem? Is there a way to ensure that every time this file is generated, that it will always have be apache:apache with read/write/execute permissions?
You can resolve this by adding a mask to your config in core.php
Cache::config('default', array(
'engine' => 'File',
'mask' => 0666,
));
There was a bug report there http://cakephp.lighthouseapp.com/projects/42648/tickets/2172 but it was considered as not being a bug.
What I personaly noticed is that some file owner may be modified when you use the cake script in the console (for instance to make a bake). The modified files then belong to the user you use in the console.
Would this mean you call cake while being root ? Or do you have any root cron job that calls a Cake shell script ?
Personaly I have now the habit to chmod the whole tmp folder content back to the apache user after having used the cake script and it seems to prevent the warning to appear.
Instead of setting giving read/write access to everyone on the tmp/cache directory I did this:
chgrp -R www-data app/tmp
chmod -R g+rw app/tmp
find app/tmp -type d -exec chmod g+s {} \;
Setting the group of the directories to the Apache user and then setting the setgid bit will allow you to ensure that files created in that directory get the proper group permissions regardless of what user runs the shell script. This also allows you to exclude read/write permissions to "other" users.
I think the reason of the problem is already explained, as the cron runs under root user and created files in tmp are not accessible by web user. The other solutions did not work for me and I did not want to set tmp permissions to 777, I ended up setting a cron job for the web user, in debian specifically it would be
crontab -u www-data -e
Taken from this answer How to specify in crontab by what user to run script?
If you're encountering the SplFileInfo error in CakePHP2 and you're absolutely certain that your file/directory permissions are set up properly, then one other thing to check is your PHP version. Cake2 requires PHP 5.2.8 or greater and although you'd usually be alerted on the default page if you were using the wrong version, you wouldn't be alerted if you'd developed your app on one server and then moved it to another.
I experienced this error after developing a Cake2 app on a PHP5.3 server and then moving it to a PHP 5.1 server. Upgrading to 5.2.17 (which is above 5.2.8) solved the problem.
Use this ..
cd cakephp/app/tmp/cache/persistent
sudo chmod 666 myapp*
cd ..
cd models
sudo chmod 666 myapp*
You need to make the app/tmp directory writable by the webserver. Find out what user your webserver runs as (in my case _www) and change the ownership of the app/tmp directory to that user: $ chown -R _www app/tmp
Another solution. Permission conflicting occurred because multi users share same files. Thus, if we split cache directory into multi sub directories, no conflicting occur and no changing default permission of directories and files required.
As following, each sub cache directory is defined by type of php api handler:
define('CACHE', TMP . 'cache' . DS . php_sapi_name() . DS);
When browser the website, active user is apache. And the sub
directory is cache/apache2handler.
When run a batch, active user is root or logging-in user.
And the sub directory is cache/cli.
Other side, current user account can be used to name sub directory. Check at
How to check what user php is running as?
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