I am planning to learn cakePHP. I already installed composer globally, but whenever I run composer self-update && composer create-project --prefer-dist cakephp/app my_app, I get an error saying:
[ErrorException]
copy(/Users/a/.composer/cache/files/cakephp/cakephp/4528680ebd888b7778e5755c957f
c9a26a0d10d1.zip):failed to open stream: Permission denied.
To be exact, this error runs after the ff things:
- Installing cakephp/plugin-installer(1.1.0): Loading from cache
- Installing aura/intl (3.0.0): Loading from cache
- Installing psr/http-message (1.0.1): Loading from cache
- Installing zendframework/zend-diactoros (1.7.2): Loading from cache
- Installing psr/log (1.0.2): Loading from cache
- Installing cakephp/chronos (1.1.4): Loading from cache
- Installing cakephp/cakephp (3.6.5): Downloading (100%)
I also tried running
sudo composer self-update && composer create-project --prefer-dist cakephp/app my_app
but still the error persists. Any ideas why this is happening?
Change directory to your project directory:
cd cakePHPproject
if you know under what user your web server is running then:
chown -R "userWebserverIsRunning" . * without " "
above will recursively (-R) change the owner of the files in your current directory (.)
Also set:
chmod -R 777 tmp
chmod -R 777 logs
PS, If you do not know under what user your webserver is running please run:
ps -ef | egrep '(httpd|apache2|apache)' | grep -v `whoami` | grep -v root | head -n1 | awk '{print $1}'
You can read more on cake's documentation:
https://book.cakephp.org/3.0/en/tutorials-and-examples/blog/blog.html#directory-permissions-on-tmp-and-logs
Have fun!
Set the ownership for the cache directory using chown -R this will recursively change ownership for all files and folders inside cache directory if any
Reference
Related
I have tried the following steps to install and setup mongodb in my mac from here https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ but I got the following error when running the final "mongo" command in my terminal:
Error Message - Zsh: Command Not found : mongo
This error msg occurred after trying to install mongodb 4.2 using brew
sudo chown -R $(whoami) $(brew --prefix)/*
then
brew tap mongodb/brew
then
brew install mongodb-community#4.2
and
brew services start mongodb-community#4.2
or
mongod --config /usr/local/etc/mongod.conf
then
ps aux | grep -v grep | grep mongod
and
mongo
running brew services start mongodb-community#4.2 returns:
Successfully started `mongodb-community#4.2` (label: homebrew.mxcl.mongodb-community#4.2)
running ps aux | grep -v grep | grep mongod returns:
9081 0.2 0.5 5528024 41856 ?? S 3:01pm 0:01.48 /usr/local/opt/mongodb-community#4.2/bin/mongod --config /usr/local/etc/mongod.conf
7613 0.0 0.1 4298832 5600 s000 T 2:47pm 0:00.08 vim /usr/local/etc/mongod.conf
running mongod --config /usr/local/etc/mongod.conf returns:
zsh: command not found: mongod
There are also no mongo files in my /usr/local/bin directory after using these commands
I created a data/db folder in my /usr/local/bin directory using the following commands:
sudo mkdir -p /usr/local/bin/data/db
sudo chown -R `id -un` /usr/local/bin/data/db
Running "brew update" returns:
brew update
Updated 1 tap (homebrew/cask).
==> Updated Casks
brave-browser
brew install mongodb-community-shell
Fixed the problem for me.
Solved it by manually installing the mongodb community files and db tools using the website instead. Then copying them into /usr/local/bin. Then ignoring the app permissions whenever calling mongo or related commands in the terminal through System Preferences > Security & Privacy > General.
After googling I found out that mongoimport and the other features have to be installed separately: https://www.mongodb.com/try/download/database-tools
Followed by copying those bin files after extracting them into the same /usr/local/bin directory
Not sure why its' not working through homebrew though
This worked for me, I was having same issue on mongodb-community#4.4
brew reinstall mongodb-community#4.4
On terminal something like this will appear during reinstallation.
copy highlighted path with echo
echo 'export PATH="/opt/homebrew/opt/mongodb-community#4.4/bin:$PATH"' >> ~/.zshrc
Now open another terminal and start mongodb services
brew services restart mongodb/brew/mongodb-community#4.4
write mongo on terminal and here we fly
If you installed the mongodb via Homebrew. Need to add the mongo path in your bash_profile.
Edit the bash_profile vi ~/.bash_profile
Add the below line in EOF export PATH=$PATH:/usr/local/opt/mongodb-community#4.2/bin
After the edit bash_profile. Close all terminals and open them again. mongo command start works.
In addition to #ramesh-babu-t-b 's answer, https://stackoverflow.com/a/68407530/1279516, the issue could also be that your MongoDB installation did add mongod to your path, but the installation happened within the current shell session, and so your shell doesn't have the updates to the PATH variable yet.
In this case, only his last step is still necessary - Open a new console window and retry the mongod command.
I have problem a with build React-Native app using Gitlab CI.
My build always fails with error:
ENOSPC: System limit for number of file watchers reached, watch ~
What i tried:
Increase 'fs.inotify.max_user_watches' value with command ...
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
... inside gitlab-ci.yml file. This solution works on my private gitlab.com account but with the self-hosted by company unfortunately got error:
sysctl: permission denied on key 'fs.inotify.max_user_watches'
(no matter if I use shell or docker executor).
Shutdown watchman with command (also in gitlab-ci.yml):
watchman watch-del-all && watchman shutdown-server
... but the error still appears.
Build docker image with pre-configured value but that's not possible.
My questions are:
Is there any other way to solve this problem without asking admin to change this value on the runner?
If watchman is needed for 'watch' files when they change then why that's also used for build apk? Maybe is there some way to not using watchman for apk build?
This error:
status code 400 (Selenium::WebDriver::Error::ServerError)
is displayed after my test fails on a step where I have pasted input to a field. The test started to fail after I updated Selenium WebDriver to 3.6.0 and Firefox to 56.0.
I'm using Ruby - Capybara - Cucumber. What's the reason of a failure and how can I fix it?
upgrade your geckodriver
macOS:
brew install geckodriver
I hope it helps you.
I had the same issue on my deploy ubuntu server.
I installed geckodriver with this script
Before running run this
sudo apt-get install jq
install_dir="/usr/local/bin"
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
if [[ $(uname) == "Darwin" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos"))')
elif [[ $(uname) == "Linux" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
else
echo "can't determine OS"
exit 1
fi
curl -s -L "$url" | tar -xz
chmod +x geckodriver
sudo mv geckodriver "$install_dir"
echo "installed geckodriver binary in $install_dir"
Available on github.gist
It downloads latest bin version for geckodriver from official repo.
But it didn't help me. After many hours of investigation what is wrong I came across very strange issue.
geckodriver -v in my $HOME directory returned 0.19.1 version
But when I go to my deployed project path by capistrano.
cd ~/apps/app_name/production/current
geckodriver -v
=> 0.14.1
which geckodriver
=> /home/$USER/.rvm/bin/geckodriver
rm -rf /home/$USER/.rvm/bin/geckodriver
=> geckodriver -v
0.19.1
So I have first to delete .rvm default version for project, and then my global geckodriver version became available for application.
Is it possible to run Solr 4.4 with jetty 6.1 from Ubuntus package repository? I followed this example:
http://www.kingstonlabs.com/blog/how-to-install-solr-36-on-ubuntu-1204/
And tried some other examples, but it seemed to be impossible to run run Solr 4.4 from Jetty's webapps directory.
In the example you can read in the comments, that people ended up with 404 when try to reach
http://localhost:8080/solr
I tried also the configuration steps from the Apache Solr 4 Cookbook by Rafal Kuc, page 6 "Running Solr on Jetty"
Here a summary of the steps:
tar xvfz solr-4.4.0.tgz
sudo cp ~/solr-4.4.0/example/webapps/solr.war /usr/share/jetty/webapps
sudo mkdir /usr/share/jetty/temp
sudo cp ~/solr-4.4.0/example/contexts/solr-jetty-context.xml /usr/share/jetty/contexts
#Change temp dir
sudo vi /usr/share/jetty/contexts/solr-jetty-context.xml
sudo cp ~/solr-4.4.0/example/etc/jetty.xml /usr/share/jetty/etc/
sudo cp ~/solr-4.4.0/example/etc/webdefault.xml /usr/share/jetty/etc/
sudo cp ~/solr-4.4.0/example/etc/logging.properties /usr/share/jetty/etc/
sudo mkdir /usr/share/solr
sudo cp ~/solr-4.4.0/example/solr/solr.xml /usr/share/solr/
sudo mkdir -p /usr/share/solr/collection1/conf
sudo cp ~/solr-4.4.0/example/solr/collection1/conf/schema.xml /usr/share/solr/collection1/conf/
sudo cp ~/solr-4.4.0/example/solr/collection1/conf/solrconfig.xml /usr/share/solr/collection1/conf/
# JETTY_HOME = 0.0.0.0; NO_START=0;
# JAVA_OPTIONS="-Xmx256m -Djava.awt.headless=true -Dsolr.solr.home=/usr/share/solr/"
sudo vi /etc/default/jetty
But
http://localhost:8983/solr
is not reachable afterwards. If found some error messages in the logs and i think that the jetty.xml from the Solr 4.4.0 files which substituting the Jetty 6.1 jetty.xml does not work with the rest of jetty 6.1
I remember so issues in the logs about Java/Jetty Server classes. i think tey differ.
Anybody with experiences in this case an can surely confirm my guess?
The clue is to integrate the libs from the solr example directory example/lib/ext into the solr.war.
Extract the files from the solr.war. Then put the libs into the WEB-INF/lib folder.
Create a new solr.war with the libs included.
I have a standard homebrew install inside of usr/local/
When I try:
Larson-2:~ larson$ brew install postgresql
Error: Cannot write to /usr/local/Cellar
And when I use sudo:
Larson-2:~ larson$ sudo brew install postgresql
Cowardly refusing to `sudo brew install'
What am I doing wrong?
You somehow have limited permissions to /usr/local/Cellar. Brew doesn't like to install with sudo which is why it refuses.
Check the permissions:
ls -ld /usr/local/Cellar
Open them up for writing:
sudo chmod a+w /usr/local/Cellar
Do not use sudo when working with brew (for security reasons).
You've to simple set-up your permissions.
So I would go even further and change the permissions to:
sudo chgrp -R admin /usr/local /Library/Caches/Homebrew
sudo chmod -R g+w /usr/local /Library/Caches/Homebrew
and then apply the specific group (either admin or staff) to user which should be allowed to use brew command. Check groups of your user via: id -Gn).
If there are further issues, run: brew doctor to see what's wrong.
I'd change the group permissions:
$ chgrp -R admin /usr/local/Cellar
$ chmod g+w /usr/local/Cellar
assuming your user account is in group admin.
This also happens if you have multiple users on your machine. If so, it would be best for you to change the user since every other approach would have you messing around with a lot more files and folders than just /usr/local/Cellar
Use su userWhoInstalledBrew.
The problem can be solved by changing the directory's owner to the current user:
sudo chown -R $USER /usr/local
This answer is taken from: https://github.com/Homebrew/homebrew/issues/17884
Following the advice chukcha14 provided in his answer at There is no Cellar file in my usr/local dir for brew, I did this:
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community#4.2
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local
jaimes-mbp:SMR jaimemontoya$ sudo mkdir /usr/local/Cellar
Password:
jaimes-mbp:SMR jaimemontoya$ sudo chown $(whoami) /usr/local/Cellar
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community#4.2
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
==> Installing mongodb-community from mongodb/homebrew-brew
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.3.tgz
###################################################################################### 100.0%
Error: Failed to install plist file
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink .
/usr/local/opt is not writable.
You can try again using:
brew link mongodb-community
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mongodb/brew/mongodb-community`
==> Caveats
To have launchd start mongodb/brew/mongodb-community at login:
ln -sfv /usr/local/opt/mongodb-community/*.plist ~/Library/LaunchAgents
Then to load mongodb/brew/mongodb-community now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
Or, if you don't want/need launchctl, you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
🍺 /usr/local/Cellar/mongodb-community/4.2.3: 20 files, 304M, built in 110 seconds
jaimes-mbp:SMR jaimemontoya$ sudo mkdir /usr/local/opt
jaimes-mbp:SMR jaimemontoya$ sudo chown $(whoami) /usr/local/opt
jaimes-mbp:SMR jaimemontoya$ brew link mongodb-community
Linking /usr/local/Cellar/mongodb-community/4.2.3... 13 symlinks created
jaimes-mbp:SMR jaimemontoya$
funny but I received the Error: Cannot write to /usr/local/Cellar message due to lack of disk space .. :/ ( 18MB left )