Magento command not working on ssh terminal - magento

I logged in to my terminal for run the magento command,after login to ssh on my command prompt and hit the command,and its not returning anything.
here is the command
[root#new-mt5 dev.ia****nce.com]# php bin/magento indexer:reindex
[root#new-mt5 dev.ia****nce.com]#
after hitting the command it not returning anything, I am using this command to my magento root dir.
how to solve this issue?

Follow this steps:
Try to check the env.php file . check if all the environment settings are correct. make sure your SQL server is running.
try to check the files permission check this docs -> Filesystem permissions
Make sure you PHP version are compatible with your M2 version.
Try to remove cache rm -rf var/cache var/page_cache generated/code generated/metadata

are you on the right directory? check if the magento binary is there. you can do this by listing bin directory (ls bin/)

I know this is old, but this can help someone else
Check your php.ini for memory limits.
You can put something like 6g for a better performance or event -1 for maximum available memory.

Related

Installing Magento on CentOS nightmare (AVC denial)

I'm trying to install Magento unto my CentOS that I'm running off Hyper-V and it's driving me crazy. I set everything up as per tutorial, but every time I reach the locale page of the setup it says "AVC denial... attempting to write to /var. I'm pretty new with linux but I tried almost everything, I did what the error told me and set the label of the /var directory and all the directories below it to httpd_sys_content_t and made sure it has write permission. After that didn't work I gave up and decided to reposition the server to a custom folder in /usr directory, I changed all the apache config files so it doesn't mention /var directory at all, but the apache process is still attempting to write to it for some reason. Can anybody help me out with this?
Try
grep "denied" /var/log/audit/audit.log
What's there?
And for your information, Magento want to access file on magento folder var, log or report or cache
Go to your Magento folder and you can change it with
sudo chmod -R 777 var
it will give access to write and change file inside there.

Installing dropbox (and use Kirby CMS) on openshift

I'm trying to find a way to integrate Kirby CMS with Dropbox running on Openshift using these tutorials:
http://getkirby.com/blog/kirby-meets-dropbox
http://getkirby.com/forum/how-to/topic:561
I already get stuck installing Dropbox, since I assume I don't really have permission while SSHing:
http://www.dropbox.com/install?os=lnx
So my question: Is there even any way of achieving all that greatness? If no, not even if we get reaaaally creative? If NO, why not? If yes, how?
Thanks a bunch!
I have no experience with Kirby, but here's how to get Dropbox working on Openshift.
The following is a combination of doing a Dropbox install on a server and doing it in a non-standard location. Everything gets done in $OPENSHIFT_DATA_DIR because that's where you have write privileges.
First, make sure you're in $OPENSHIFT_DATA_DIR
cd $OPENSHIFT_DATA_DIR
Next, download the appropriate version of Dropbox:
wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -
This should give you the .dropbox-dist folder in $OPENSHIFT_DATA_DIR.
Next, tell Dropbox to start the installation process, but tell it that your home directory is actually the $OPENSHIFT_DATA_DIR:
HOME=$OPENSHIFT_DATA_DIR ./.dropbox-dist/dropboxd start -i
Follow the instructions to link your Dropbox account to the Openshift server. After it's linked, it should start syncing everything in your Dropbox account to $OPENSHIFT_DATA_DIR/Dropbox. This might be a bad thing for you because you have too much data in your Dropbox account. If so, then you should exclude folders.
You can do that with the CLI script that Dropbox provides. Still in $OPENSHIFT_DATA_DIR, download it:
wget -O dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py"
Make sure it's executable:
chmod +x dropbox.py
You need to run it the same way you would Dropbox:
HOME=$OPENSHIFT_DATA_DIR $OPENSHIFT_DATA_DIR/dropbox.py -h
Hope that helps.
You should be able to download/compile/install things into your OPENSHIFT_DATA_DIR (app-root/data) on your gear by using something like ./configure --prefix=~/app-root/data/dropbox, i tried that but i ran into missing the nautilus-whatever package, which i assume you could download and install in the same fashion, but i did not try past that point. As long as whatever you are running can be installed into the app-root/data, and does not require root permissions to run, you should be able to do it. If you get it going, you could also create a downloadable cartridge to run install it more easily.

Why does npm need sudo for EVERYTHING?

I don't know how I've managed it but npm seems to need sudo for absolutely every command, even npm help does not work without sudo. If I use a command without sudo, I do not see am EACCESS error, but instead my terminal session hangs and then just closes that tab (I use iTerm on Mac).
I have tried changing the ownership of my local .npm folder, outlined here and also done the same on my /usr/local/bin folder where node is installed but none of these allow me to just run npm without sudo, even when installing local packages...! It seems to me that something has screwed along the way, can anyone help?
Many thanks
I encountered the same error after a fresh install of 0.12.4 today; this solved the problem for me:
sudo chown -R $(whoami):admin /usr/local/lib/node_modules
In my particular case, I noticed that this folder was owned by '{some-large-integer-account}:wheel'...YMMV
If that doesn't solve it, take a look at the ownership of the folders that are being blocked as mentioned in the EACCESS error trace. If you're not sure what the ownership should be, you can usually infer it from the sibling dirs' ownership.
I had this as well on my machine. What I did to fix it (there are probably much less extreme ways) was to completely remove npm, and then did a fresh installation node.js (with which npm is included) from http://nodejs.org/ making sure I didn't install as root. That then allowed me to use npm without root (except for global installs).
Take ember project for example, I give all related project directory root:
neil#neil-System-Product-Name:~/Projects/ember-quickstart$ sudo chown -R $(whoami) /home/neil/Projects/ember-quickstart/
neil#neil-System-Product-Name:~/Projects/ember-quickstart$ ember s
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
Livereload server on http://localhost:7020
Build successful (10679ms) – Serving on http://localhost:4200/
Slowest Nodes (totalTime => 5% ) | Total (avg)
----------------------------------------------+---------------------
Babel (18) | 7561ms (420 ms)
Concat (8) | 1872ms (234 ms)
Rollup (1) | 629ms
Use the below option.
Open the terminal and cd to your Home directory and run the below command.
mkdir "${HOME}/.npm-packages"
Then this command after that.
npm config set prefix "${HOME}/.npm-packages"
Next, open your .zshrc file using the open -t .zshrc command and add the following to it.
NPM_PACKAGES="${HOME}/.npm-packages"
export PATH="$PATH:$NPM_PACKAGES/bin"
# Preserve MANPATH if you already defined it somewhere in your config.
# Otherwise, fall back to `manpath` so we can inherit from `/etc/manpath`.
export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"

Insecure world writable dir /Users/username in PATH, mode 040777 when running Ruby commands

When I run Ruby commands like gem -v I get this error:
/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4:
warning: Insecure world writable dir
/Users/kristoffer in PATH, mode 040777
1.6.2
First of all I don't understand what this means. /Users/kristoffer is not in my path according to echo $PATH. The result of echo $PATH is:
/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/gems/ruby-1.9.2-p180#global/bin:/Users/kristoffer/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/kristoffer/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
As you can see, the PATH is pretty clean. Just the default path + what RVM added.
I've seen the other posts similar to this where the recommended way to solve the issue is to run chmod go-w path/to/folder
However, I'm pretty sure that it's a bad idea to make my Home folder non-writeable, right? I've repaired permissions using Disk Utility and it didn't find anything wrong with the permissions on my Home folder.
Any idea of what the problem is and how I can fix it?
Your home folder should only be writable by you, not by anyone else. The reason gem is complaining about this is that you have folders in your PATH that are inside your (insecure) home folder, and that means that anyone who wants to could hack you by renaming/moving your .rvm folder and replacing it with an impostor.
To fix your home folder, run chmod go-w /Users/kristoffer. If there are any other insecure folders on the way to anything in your PATH, you should fix them similarly.
BTW, the reason that Disk Utility didn't repair this is that it only repairs files installed as part of the OS (see Apple's KB article on the subject). There is an option to repair home folder permissions if you boot from the install DVD and run Password Reset from the Utilities menu, but I'm not sure if it resets the permissions themselves or just ownership.
I kept getting this in my prompt.
I couldn't get it quite right with my command prompt but this ended up working.
Recently this just happened to me and it has to do with a bug in upgrading to Mac OSX 10.9.3. Looks like the upgrade changes the permissons to the User folder. Here's an explanation and a fix:
http://derflounder.wordpress.com/2014/05/16/users-folder-being-hidden-with-itunes-11-2-installed-and-find-my-mac-enabled/
chmod 755 /Users/<username>
Should fix the problem...
it says that the directory Users/username is insecure, you can fix that by running
sudo chmod go-w Users/username
I found a solution. Like user2952657, I got this warning with vagrant up after upgrading to OSX 10.9.3. Updating iTunes to 11.2.1 was all I needed to do to get the warning to stop.

Timezone with symfony 2

I've got some troubles whith Symfony 2, trying to generate schema via :
php console/app generate:schema:create
I've got a pretty error :
[Exception]
DateTime::__construct(): It is not safe to rely on the system's
timezone settings. You are *required* to use the date.timezone
setting or the date_default_timezone_set() function.
In case you used any of those methods and you are still
getting this warning, you most likely misspelled the timezone
identifier.
We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Thus, I'm trying to change the timezone in my php.ini with
date.timezone = 'Europe/Paris'
but even if I'm reloading my apache, I still get
date.timezone Europe/Zurich Europe/Zurich
if I look at my phpinfo(), so I don't really know what should I try next ... And I'm not even sure that I'm in the good way.
Thanks for helping me
On mac, if you have /etc/php.ini.default, do
sudo cp /etc/php.ini.default /etc/php.ini
and then do
php --ini
to see that it now loads a php.ini file.
this that trick
and se /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini
datetime = 'America/Lima' for example
and run command
$ sudo apt-get install php5-sqlite
$ sudo /etc/init.d/apache2 restart
Some third-party distributions of PHP (including MAMP) have hard-coded the timezone. For instance, MAMP 2.0 is hard-coded to Europe/Berlin, and there is no way to change this. Even changing the value in the php.ini template has no effect, because MAMP overwrites your value. Are you using PHP from source, a pre-compiled package, or PHP as a part of some kind of LAMP stack?
If you are on debian based, you must modify the parameter in the file /etc/php5/cli/php.ini, changing it in /etc/php5/apache2/php.ini has no effect.
I know this is an old ticket, but since I was having a problem with this too, and it's still open I thought I'd share my quick 'n' dirty solution:
In my case, date.default was not set at all and I wasn't in a position to change php.ini. So, as a stopgap I added date_default_timezone_set('Europe/Dublin') at the start of web/app.php to change the timezone at runtime, which worked nicely for me.
If you're using the console to run any commands you will probably have to add the call to the the top of this script also.
I ran into this problem with my shared host. they told me I couldn't change time zones via php.ini, but you can try an .htaccess file instead.
create the .htaccess in the folder where Symfony is installed and put the following code in it:
SetEnv TZ America/Sao_Paulo
hope this helps.
cheers,
Luciano
For Windows, I installed XAMPP for the webserver and downloaded PHP and installed it so that I could run the symfony commands from command prompt.
In this case, the php.ini file used when I execute a Symfony command is located in C:\Program Files(x86)\PHP\php.ini. You have to have admin rights in order to edit this file, so I launched Notepad++ as administrator and opened the file.
Look for date.timezone and modify it according to your timezone e.g. date.timezone = Africa/Nairobi. Timezones are listed on the php website, just search php, timezones. No need to restart your computer or webserver.
I just encountered this problem with XAMPP on Mac 10.11.5, PHP 5.6.8
My error read "Warning: date_default_timezone_get(): Invalid date.timezone value 'America/Los Angeles',"
I fixed it by finding the only problem was the missing underscore in the "Los Angeles" entry for my PHP.ini date.timezone setting.
Try to execute this command:
sudo ln -s /usr/local/php5/lib/php.ini /etc/php.ini
Mac in my case.
First - config path, second - don't change.

Resources