For root access composer not found in centos 7 - terminal

I installed composer in centos 7.
When I logged in with centos user, if I hit composer -v, it shows that composer is installed.
But after I switch to root access with sudo su, if I hit composer -v, it displays not found.
Can anyone help me? What should I do now?

What you describe are the symptoms of non-packaged install.
If something is available from packages, you should strive to install it using packages where available.
sudo yum install epel-release
sudo yum install composer
# have no problems, have a cup of coffee

Related

Mariadb installation on Amazon linux 2

Can someone provide steps to install mariadb on amazon linux 2?
I am pretty new in linux, so a little detail will be greatly appreciated. I have seen few links to install maria db on centOs but not sure if the same works for Amazon linux 2
If you use sudo yum install mariadb You'll get MariaDB version 5.5 which is an older version of MariaDB to get the latest version you will need to do the following.
sudo amazon-linux-extras enable lamp-mariadb10.2-php7.2=latest
sudo yum install mariadb mariadb-server
Note This will not work if you have php >= 7.3. If this is the case you must uninstall php before doing the steps above, using sudo yum erase php-common
sudo amazon-linux-extras disable lamp-mariadb10.2-php7.2=latest
Now mariadb is installed. I first tried to add centos 7 repo, but wasn't successful in getting it to install correctly.
Here you go:
Install and Start MariaDB
sudo yum update -y
sudo yum install -y mariadb-server
sudo systemctl start mariadb
sudo systemctl enable mariadb
Secure DB server. Select the relevant option's during command run.
sudo mysql_secure_installation
But I recommend you to install MariaDB from official repo for latest version by following instructions in this link.

How to Install / Uninstall Laravel Supervisor (supervisorctl)?

I'm using Laravel homestead for dev, but my QA server is on Amazon Linux. Which is CentOS-7 based.
I have installed Supervisor on my Dev the way it is said on Laravel docs
sudo apt-get install supervisor
And now I'm stack.
It does not say how to uninstall it, and it does not say how to install it on Amazon Linux.
How to Uninstall Laravel Supervisor from Homestead?
And how to install/uninstall it on Amazon Linux?
If you installed it with apt-get then you should be able to remove it with the same package manager.
https://askubuntu.com/a/1144
E.g. with one of the following commands:
sudo apt-get remove supervisor # remove the package
sudo apt-get purge supervisor # remove the package and all configs
As for CentOS, try it with yum
yum install supervisor
yum remove supervisor
https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s1-yum-useful-commands.html
Similar question:
https://stackoverflow.com/a/47322239/3095084

On running in Ubuntu 16.04 ./createPeerAdminCard.sh it fails

composer-cli v0.19.2 was successfully installed still on running this error occurs.
Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv11
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
No version of composer-cli has been detected, you need to install composer-cli at v0.19 or higher
The problem is that if you install composer using root or sudo then it is not available to non-root users.
The pre-reqs doc for Composer warns not to use root or sudo, but the warning is actually missing in the install doc itself.
I would recommend uninstalling composer-cli (and playground, rest-server etc) with a command like sudo npm uninstall -g composer-cli then re-install without using sudo. If you have permission problems with npm install there are some notes in the composer knowledge wiki.

How to install Rabbitvcs on centos7?

I'm used to tortoise SVN. But after switching to centos 7 it is very difficult to use it without GUI. Please Help me install RabbitVCS instead.
The below instructions worked for me in May 2019. YMMV.
Install EPEL Release
export http_proxy=http://{proxyhost}:{port}
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install epel-release-latest-7.noarch.rpm
Install Pre-requisites
sudo yum install meld pysvn python-dulwich python-simplejson
Fetch RabbitVCS packages
export ftp_proxy=$http_proxy
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/hmandevteam/CentOS_7/noarch/rabbitvcs-core-0.17.1-3.2.noarch.rpm
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/hmandevteam/CentOS_7/noarch/rabbitvcs-cli-0.17.1-3.2.noarch.rpm
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/hmandevteam/CentOS_7/noarch/python2-rabbitvcs-0.17.1-3.2.noarch.rpm
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/hmandevteam/CentOS_7/noarch/rabbitvcs-nautilus-0.17.1-3.2.noarch.rpm
Install RabbitVCS packages
sudo yum install rabbitvcs-core-0.17.1-3.2.noarch.rpm
sudo yum install rabbitvcs-cli-0.17.1-3.2.noarch.rpm
sudo yum install python2-rabbitvcs-0.17.1-3.2.noarch.rpm
sudo yum install rabbitvcs-nautilus-0.17.1-3.2.noarch.rpm
Reboot
sudo reboot
Open File Manager and you can see RabbitVCS Menu
If the above rpm ftp locations become stale, goto http://rpm.pbone.net and search for the following packages with Centos 7 filter -
rabbitvcs-core
rabbitvcs-cli
python2-rabbitvcs
rabbitvcs-nautilus
You may find these packages at other locations too
NOTE: You may sometimes require these pre-requisite packages too pygtk, python-configobj, python-gobject, python-gtkspell, python-svn
I had same problem when working with centos7, ended up using thunar instead of nautilus. See stackexchange and github issue.
Update:
I have successfully build rabbitVCS following steps from the github.com and then copied the nautilus extension.

Magento Upgrade error: Uri doesn't contain host part

I am trying to upgrade from Magento 1.4.1 to the latest version using the following guide aon ubuntu 12.04 through terminal:
http://turnkeye.com/blog/magento-upgrade-guide/
however when I run a command through mage e.g.:
./mage list-upgrades
or
./mage upgrade-all --force
I get the error "Uri doesn't contain host part"
Could anyone tell me what I am doing wrong?
You're missing php5-curl.
On a ubuntu(or any debian based) system you would install that with:
sudo apt-get install php5-curl
Make sure your stack contains all required packages (php5, php5-curl, php5-mcrypt, php5-gd) if not then apt-get install them and restart your stack.

Resources