Installing Symfony 2 on Mac - macos

I am new with Symfony and I cannot manage to install it on my MAC book pro (version 10.9.5).
I go the the Terminal and execute this code (as explained but in a folder "symphony" I created in MyDocuments):
MacBook-Pro-de-Sophie:~ sophiejarlier$ cd Documents
MacBook-Pro-de-Sophie:Documents sophiejarlier$ sudo curl -LsS https://symfony.com/installer -o /symfony
MacBook-Pro-de-Sophie:Documents sophiejarlier$
But nothing has been installed, the folder symphony is empty... Should I install something else before? I am lost...
Thanks for your help.

You are new in terminal also. What you done is just you downloaded symfony installer in your main root directory / where is main stuff like /var, /usr etc.

You forgotten the installation part.
Move your symfony installer (just downloaded) using :
$ sudo mv /symfony /usr/local/bin/symfony
Give execution permissions :
$ sudo chmod +x /usr/local/bin/symfony
Then, go (open a terminal) in your webserver directory (default /Library/WebServer/Documents).
And do your install by executing the following command :
$ symfony new name_of_your_project
Your project is created in the folder name_of_your_project of your current directory.
All the instructions are coming from the documentation

Related

How to install Fly CLI to mac

I download the latest version of the Fly cli
https://concourse-ci.org/download.html
to ~/Downloads then cd to ~/Downloads
cd ~/Downloads
mv fly_darwin_amd64 fly
install fly
then I do
fly
and i get
-bash: fly: command not found
Is one of my steps wrong?
Try
cd ~/Downloads
mv fly_darwin_amd64 /usr/local/bin/fly
chmod 0700 /usr/local/bin/fly (Thanks to #Andrew Ramnikov)
For the newest mac os version, you need to allow the App to run from System Settings->Security and Privacy->General-> Allow app
fly -version
On MacOS, you can install with brew like, brew install --cask fly.
You might also want to install CredHub to manage credentials, brew install cloudfoundry/tap/credhub-cli.
Note that in the accepted answer, in Catalina and Newer the equivalent to the last step to allow the app in privacy settings is: xattr -d com.apple.quarantine /usr/local/bin/fly
And this does not require admin rights, but doing it via the GUI does.
Go to System Preferences -> Security & Privacy -> General and click allow anyway next the the fly app.
I ended up moving the fly binary to a folder in my home directory, and just added it to my path variable in ~/.bash_profile so I guess it works now.
edit
However, when I do
fly -t main login
I get
error: unknown target: main
easiest way is to run first command curl 'http://localhost:8080/api/v1/cli?arch=amd64&platform=darwin' -o fly \ && chmod +x ./fly which will create a fly binary and for the second part of command just do it manually && mv ./fly /usr/local/bin/ meaning you need to copy fly binary into /usr/local/bin

dotnet: command not found in Mac

So I downloaded NET Core 2.1 SDK for mac and installed it. But when I run the dotnet command from terminal it throws -bash: dotnet: command not found error.
I am trying to use the dotnet new react to spin up a new .Net Core/React project.
How can I fix this? Thanks!
Make sure your macOS version meets the prerequisites
https://learn.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore2x
If it does, then after installing via the installer, in a new terminal run this command
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
Then try dotnet --version
hopefully that should work
EDIT:
You might need to add x64 like so:
ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
Courtesy of Stan in the comments
For Mac M1
sudo ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
If you add symbolic link to /usr/local/bin/ but you get file exist error.
You can delete the dotnet file at /usr/local/bin/
or
at you finder Shift + ⌘ Command + G and type /usr/local/bin/ , delete the dotnet file in finder.
For M1 and M2, make sure you are installing the Arm64 version -
Marcelo Gonella
Just another way how to successfully install dotnet on a Mac: using Homebrew, you can simply run:
brew install dotnet
to have it install. Advantages include automatic updates via brew upgrade and less to worry about permissions or any of the workarounds mentioned as solutions before me.
You can find the formula information here: https://formulae.brew.sh/formula/dotnet
You also need to download & install Runtime from here
If you are using the dotnet x64 installer for mac which can be found here , use this command
sudo su
ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
I solved by editing ~/.zshrc
#Add .NET to $PATH
export PATH="/usr/local/share/dotnet:$PATH"
Run sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/ in the command line, you then should be prompted for your password. This is the solution that worked for me on Mac OS Catalina.
.NET 6.x on MacOS I had to run with updated path
ln -s /usr/local/share/dotnet/**x64**/dotnet /usr/local/bin/
Run with sudo if you getting a permission error.
I solved it this way:
Add entry to .bash_profile
Before:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/opt/gradle/gradle-4.10.2/bin
After:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/opt/gradle/gradle-4.10.2/bin:/usr/local/share/dotnet
For Rider Users: If you are installed Rider and making development on it, dotnet must be installed on your machine.
For me, I can not found dotnet installation in specified locations; here or microsoft documentations. But Rider makes its own installation.
Go to Rider - Preferences - Buildy, execution, deploymend - Toolset and build and get the path of ".NET CLI executable path". This path specifies the path of sdk installation.
You can run the command below with location you found.
sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
If you are using mac with M1 (arm) make sure you install the Arm64 version and not the x64 version that you download by default

vagrant: command not found after install on Mac OSX 10.10.4

Downloaded Vagrant, and went through th installation process.
When I ran vagrant -v it says vagrant: command not found
It has put the files in /opt/vagrant/...
It should install in the Applications folder with a link to the /usr/bin so it is added to the shell path.
There is no directory that has been created during this process.
I am afraid I can't even get started with it. ITs obviously not creating all the shortcuts it needs to be able to run the commands.
I have looked for support on this issue and reported a bug.
I also accepted the xcode licence agreement.
Has anybody else had this issue.
My next step is to manually create the shortcuts.
If you look at the uninstall script including in the Vagrant DMG, it is referring to /usr/local/bin which does not exist. It should be error handling (the Vagrant pkg installer) and create it (permissions/ownership etc) but it doesn't.
You need to mkdir the /usr/local/bin. I tried a symlink between /usr/bin/vagrant (as /usr/bin exists, and in-path) to /opt/vagrant/bin/vagrant BUT this does not work, as later on in life, Vagrant refers in a hard fashion to /usr/local/bin/vagrant because its stupid.
$ sudo mkdir /usr/local/bin
If you sudo it, it should be made with correct ownership etc. Now just re-run the Vagrant installer pkg.
Make sure the Virtual Box setup is installed on Mac before installing Vagrant.
I raised the bug with https://github.com/mitchellh/vagrant/issues/6034
The issue is that I had no /usr/local directory at all.
It is an apple issue.
After I created the directories as you described I was able to install vagrant vitrual boax and laravel.
Here is what I did.
sudo mkdir /usr/local
Then bin.
cd /usr/local
sudo mkdir bin
I uninstalled Vagrant, re-installed and when I ran vagrant -v I then got the version.
cd /usr/local/bin
ls
sudo chmod 755 vagrant
Thanks for your Answer.
Weird, on 1.8.5 I couldn't run Vagrant either, noticed that /usr/local/bin was owned by root. Ran command
# chown -R User:Group /usr/local/bin
as root and works from my username now.

Mongod: Command Not Found (OS X)

I am trying to test MongoDB and I have it all downloaded and moved into the root folder. I can navigate to the folder that holds the mongod, but when I try to run it by typing "mongod" into my terminal, I get a message that says:
"mongod: command not found"
Both answers above are correct.
You can either specify the path in one of the following files: .profile, .bashrc, or .bash_profile
export PATH="$PATH:/usr/local/mongodb/bin"
then call the daemon or the shell directly
mongod
mongo
Or for the commands not in the $PATH, use ./mongo or ./mongod from the directory containing these files. This solution can be verbose has you will have to eventually append the whole path when calling these commands from another directory.
/usr/local/mongodb/bin/mongod
or
/usr/local/mongodb/bin$ ./mongod
"Mongod" isn't a stand-alone command. You need to run the command like this:
./mongodb/bin/mongod
I used this webpage to help me answer this question.
This worked for me:
brew tap mongodb/brew
brew install mongodb-community#4.2
mongod
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
For example, install 64bit MongoDB 2.6.12 on macOS Catalina.
(for newest versions you may go to https://www.mongodb.com/download-center/community for your platform).
Download, extract and move:
wget http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.12.tgz
tar xzf mongodb-osx-x86_64-2.6.12.tgz
mv mongodb-osx-x86_64-2.6.12/ /usr/local/mongodb/
Add to file ~/.zshrc this:
export PATH="$PATH:/usr/local/mongodb/bin"
PS: .bash_profile or .profile not worked in my case
Reload terminal (or close, open it):
source ~/.zshrc
Make directory for data and set rights:
mkdir -p ~/data/db
chown -R mongodb.mongodb ~/data/db
Run MongoDB:
mongod --dbpath ~/data/db
You need to add the name of the folder that contains the command mongod into your PATH so your shell knows where to find it.
So, if mongod is in /usr/bin/freddyfrog, you would edit ~/.profile and find the line that says PATH= and edit it to look like this:
export PATH=${PATH}:/usr/bin/freddyfrog
Then login again to make it take effect.
I received the same error message because I used the wrong command to run mongod (meant for M1s) for my 2019 MacBook with an Intel processor. You can skip past Homebrew updates and MongoDB installation but here's how I resolved my issue:
Download Xcode Command Line tools.
xcode-select --install
Allow Homebrew to add and access MongoDB:
brew tap mongodb/brew
Update Homebrew:
brew update
Install MongoDB Community Edition (#6.0 is the latest version at the time of this post):
brew install mongodb-community#6.0
macOS with Intel processors:
mongod --config /usr/local/etc/mongod.conf --fork
macOS with Apple M1 processors:
mongod --config /opt/homebrew/etc/mongod.conf --fork
Then open the shell:
mongosh
Or just run mongod.
Official documentation on installation here.
3 steps:
Step 1:
export PATH="$PATH:/usr/local/mongodb/bin"
OR
export PATH="$PATH:/usr/local/opt/mongodb#3.2/bin"
(replace version number with your local version)
The first step will allow you to run the command, but will get you another error: "/data/db does not exit" so you have to
Step 2 :
sudo mkdir -p /data/db
Now /data/db is read only, but it has to be writable also so
Step 3 :
sudo chown -R USERNAME /data/db
I was trying to install a previous version (3.6) using latest documentation (4.2 is already released). So, they now call it mongodb-community#3.6.
In order to update PATH for such setup, the statement should be
export PATH="$PATH:/usr/local/opt/mongodb-community#3.6/bin";
I got hint from #retroGiant 's answer
run this command, it works:
brew services start mongodb-community#4.0
I have installed mongodb-community#3.2, was facing the same issue. I followed below steps.
open bash profile in any editor (you can also try - vi ~/.bash_profile)
write this export PATH="$PATH:/usr/local/opt/mongodb-community#3.2/bin" & save.
do this . source ~/.bash_profile
In root directory
sudo mkdir data
cd data
mkdir db
then
sudo chown -R yourUsername /data/
copy path of your mongodb/bin downloaded folder (I suggest you put it in home folder not root dir)
in terminal
export PATH="paste the link here :$PATH"
now it should work but if not
In case you are using different Unix shell and
trying to execute mongod within visual studio code( for example ),
make sure to read the documentation to link PATH.
For example, if you are using zsh create .zprofile in your home directory.
touch .zprofile
copy your previously made PATH into .zprofile
Now everything should work as expected.
I was looking for the same and later I have found that now it's very straight forward to install the new MongoDB Community Edition like below:
Installing MongoDB 6.0 Community Edition
brew tap mongodb/brew
Note: If you haven't yet install brew then follow this link: https://brew.sh/#install
Update Homebrew
brew update
Install MongoDB
brew install mongodb-community#6.0
The installation includes the following binaries:
The mongod server
The mongos sharded cluster query router
The MongoDB Shell, mongosh
Run MongoDB Community Edition
To run MongoDB (i.e. the mongod process) as a macOS service, run:
brew services start mongodb-community#6.0
To stop a mongod running as a macOS service, use the following command as needed:
brew services stop mongodb-community#6.0
MongoDB 5.0 issue resolved - SEP/2022
do following steps
step 1: open a .zshrc file if it does not exist it will create by itself by following the command. For opening or creating a .zshrc file below command is the same.
vim .zshrc
step 2: insert value in it by pressing 'i'
step 3: insert the below command there or paste it there.
export PATH="$PATH:/usr/local/opt/mongodb-community#5.0/bin"
step 4: to exit click on esc key and the write :wq
step 5: Close the terminal and reopen it and type the below command
mongo
Output
MongoDB shell version v5.0.11
connecting to: mongodb://127.0.0.1:279021/?
compressors=disabled&gssapiServiceName=mongodb
Successfully integrated mongo 🎉 🎉 🎉
happy coding !!
If you use brew then check the path:
brew list
brew list mongodb-community#...
then add it to .zshrc
zsh: command not found: mongo
after that use mongosh instead of mongo
This answer is a little bit unrelated, but if you using vscode & would like to interact with mongoDB using command line, have a read.
I was looking to use mongod command as well (as i love to use command to interact with mongoDB), but after several attempts of install i completely give up. Until i found this, the mongoDB vscode extension.
The extension is loading the data pretty fast just like mongod command compare to mongo compass. It allow you to perform CRUD & aggregation in the mongoDB playground, and most importantly you able to retrieve the command on next execution by storing your command in a file with .mongodb extension.
*Update: After using it several weeks, everything is nice, just need to make sure you connecting to the right mongoDB connection (if you establish few different connection)

Is there a command to update redis?

I'm working on the front end for a web app, but I'm trying to learn as much of the backend setup as I can as well. I am setting up redis on a new computer myself, but running into a few hiccups.
The wget command cannot be found, so I assume it Linux only? I am following these instructions to install redis on Mac OS 10.7. I have redis 2.0.0 installed, but while attempting to install 2.4.4 using the same commands, I am told redis-server, redis-cli, redis-benchmark cannot be found, and I can't copy them to /usr/local/bin.
I could not find an update command to bring redis up to the most recent version. I don't think it should be this difficult to install the most recent version on redis on Mac OS, but I can't see what I am doing wrong.
So far as I know, typing:
$ brew upgrade redis
should work, where $ indicates your command line. If it complains about HomeBrew not being installed, you can obtain that here. Brew is an excellent package manager, and a great way of taking care of your files.
If you're not using brew, then these steps will help you get up to date.
First, find the location of your installed redis-server instance before updating. In my case, it was in /usr/local/bin/, but it might also be in /usr/bin/. If it's not here, you can type which redis-server to find the location.
Next, download the redis tar file from https://redis.io/download, then install it from the directory it downloaded to:
cd Downloads
tar xzf redis-X.Y.Z.tar.gz
cd redis-X.Y.Z
make test
make
Next, we'll move the new installed redis to the location where the current instance is running:
sudo mv src/redis-server /usr/local/bin
sudo mv src/redis-cli /usr/local/bin
Now you should be ready to use redis-server and redis-cli in the new version.
PS - I also moved the redis-benchmark, redis-sentinel, redis-check-aof, and redis-check-dump files because they were also already in /usr/local/bin.
Ref: http://jasdeep.ca/2012/05/installing-redis-on-mac-os-x/
It would be better to follow this way.
$ brew update
$brew upgrade redis
Create a bash file...
cd ~
nano .update_redis
Go into the tmp directory and download the latest stable version
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
Decompress the files
tar xvzf redis-stable.tar.gz
Compile
cd redis-stable
make
Copy the bin programs
cp src/redis-cli /usr/bin/
cp src/redis-server /usr/bin/
cp src/redis-benchmark /usr/bin/
Set Permissions
chmod 755 /usr/bin/redis-cli
chmod 755 /usr/bin/redis-server
chmod 755 /usr/bin/redis-benchmark
Execute
bash .update_redis

Resources