Magento Global Messages : what they are and do?

Thursday, 15. December 2011

If you have been working with Magento templates, I am sure you have come across the global messages instructions/references and perhaps wondered what they are and/or what do they do?

You will see them mostly on the layout phtml file i.e 1column.phtml, 2columns-left.phtml etc referenced are

echo $this->getChildHtml('global_messages');

Well, by default Magento stores all the messages (success/errors/warnings) in a specific session array. So whenever a page is being rendered, Magento will reference to this session array to see if there is any sort of message that needs to be displayed for this particular page.

If any exist, Magento will get it shown on the this loading page and critically enough, it then removes/clears the messages from its array.

So if you have ever wondered, how come the references to global_messages are there but you don’t see anything on the front-end, well, its simply because there is no message to show in the array session! And when you see messages such as your products has been added successfully to the shopping cart, The configuration has been saved etc they are global messages!

Get Disk and directory Size in linux using shell command

Tuesday, 6. December 2011

Folder size in human readable numbers

$ ls
dir1  dir2
$ du -sh dir1
2.4M  dir1

Disk Space Usage

$ df -kh

Sort Folders By Size

du -H --max-depth=1 /home/ | sort -n -r

Magento currency ‘USD’ not found

Saturday, 3. December 2011

After restarting the memcached – I received this error and here how I went about resolving this.

Run Compiler Again

Systems > Tools > Compilation > Run compiler

Flush the Cache

The System > Cache management > Flush Cache Storage.

Remove all the files from var/* (especially cache, locks and sessions)

If you are running Memcache – You may want to

killall memcache

Then: restart again

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 start

Memcache and NGINX – strart and stop services – cheat sheet

Saturday, 3. December 2011

start nginx:

sudo /usr/local/nserver/nginx/sbin/nginx

stop nginx:

sudo kill -HUP $( cat /usr/local/nserver/nginx/ )
sudo kill -QUIT $( cat /usr/local/nserver/nginx/ )

The master process can handle the following signals:

TERM, INT– Quick shutdown
QUIT– Graceful shutdown
KILL– Halts a stubborn process
HUP– Configuration reload. Start the new worker processes with a new configuration. Gracefully shutdown the old worker processes
USR1– Reopen the log files
USR2– Upgrade Executable on the fly
WINCH– Gracefully shutdown the worker processes

There’s no need to control the worker processes yourself. However, they support some signals, too:

TERM, INT– Quick shutdown
QUIT– Graceful shutdown
USR1– Reopen the log files

Start Memcache:

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 start

Start Memcache:

/usr/local/nserver/memcached/bin/memcached -d -uroot -m512 -p11211 stop

You way want to try: sudo locate ‘memcache’ OR ‘’ in order to locate your paths.