Author Archives: admin

Fatal error: Class ‘Imagick’ not found

In Magento(apache server) when file upload has some problem like Fatal error: Class ‘Imagick’ not found then there is missing one package called ‘Imagick’
to solve this problem we need to install this package in apache server in ubuntu or debian it can be install with following code

 sudo apt-get install php5-imagick 

and then restart your apache with following command

sudo /etc/init.d/apache2 restart

Install PHP cache in Ubuntu

Caching is one of the most powerful features in PHP. Here is the step to install.
First install php5 and other required package with sudo Authentication

sudo apt-get install apache2-threaded-dev php5-dev php-pear make

Then install APC package

sudo pecl install apc

if there is asking some yes/no just write yes and the Last step add installed extension in php configuration like this

sudo vim /etc/php5/conf.d/apc.ini

and then insert following code in opened file “apc.ini”

Getting Magento static Block in template page(phtml file)

One of the great feature of Magento is the static block which makes it’s CMS system really flexible. Here is the way how to create static block from admin and getting it in Magento Template page

  1. Login in Magento admin and go to CMS->Static Block
  2. Then click on Add New Block
  3. Then give the title of the Block and Identifier of the block (it is my_static_block in this example. This should be unique and please don’t include special character. If there is multi domain or multi store select and then Enable yes and then write the content that you want in your static block

Now this static Block can get from our template file(phtml file) in our magento design directory(for example app/design/default/default/template/page/html/header.phtml) with following code

echo $this->getLayout()->createBlock('cms/block')->setBlockId('my_static_block')->toHtml();

please don’t forget my_static_block our static block Identifier.