Magento 2 admin sesssion timeout settings

The backend session in Magento is with short lifetime only 900 seconds which is 15 minutes. To extended it, login to admin panel and navigate to:
Stores->Settings->Configuration->Advanced->Admin->Security->Admin Session Lifetime (seconds)
change it from 900 to 3600 which is 1 hour.
admin session lifetime

Posted in Magento 2 at June 22nd, 2016. No Comments.

Create admin user using CLI

Hello, today I will show you how to create administrator user using cli:
Open terminal and navigate to magento root folder. Use this command to create user for magento admin panel:

php bin/magento admin:user:create --admin-user="administrator" --admin-password="password123@" --admin-email="" --admin-firstname="Admin" --admin-lastname="Admin"

Press enter and login with new user.
If the admin user exist the command will change current credentials with the new one, that are provided in the console command.

Posted in Magento 2 at May 19th, 2016. No Comments.

WordPress uploaded images not resizing

If you are running wordpress and wondering why the images are not resizing the problem is probably that you don’t have gd extension installed or enabled in your php configuraiton.You can check thru your terminal is the gd extension installed with command:

php -m

Or to open call phpinfo and check for gd library.


If you don’t find GD library, please install it and you are done.

p.s. Be sure you reupload the images again.

Posted in Wordpress at August 20th, 2015. No Comments.

Install APC on 64bit WAMP server

I’ve been getting a lot of requests from users to make new post for WAMP server 64bit with APC extension. And so here it is.

First you must go to Wamp server home page. For this tutorial I choose to use this WAMP server with this options:

  • WAMPSERVER (64 BITS & PHP 5.3) 2.2E
  • Apache 2.2.22
  • Mysql 5.5.24
  • PHP 5.3.13
  • XDebug 2.1.2
  • XDC 1.5
  • PhpMyadmin
  • SQLBuddy 1.3.3
  • webGrind 1.0

The installation of the WAMP server is easy and I will not explain how to do it.Now lets go and download the apc extension that will work for us. Go to this site and download apc extension Download APC extension. Be careful which one you choose, because there is a lot of APC extensions. First pick that one that is appropriate for your php version. In my case that is PHP 5.3. After that you must choose thread safe or not thread safe APC extension to pick for download.
Now click on your wamp icon and click on Localhost page at the top of the menu. Your browser will open and will open localhost page, find phpinfo() link and click on it. You will be able to see your configuration, find this option “Thread Safety“. If it is enabled then you need Thread safe version of APC extension. So we need this apc extension for download:
APC 3.1.14 beta for PHP 5.3 03/01/2013 53 KB APC
If you want to see more info click on more href to see more info otherwise just click download. Now we have the extension and must put it in the extension folder for php extensions. In my case the folder path is: C:\wamp\bin\php\php5.3.13\ext. Now you need to enable the apc extension. There is two ways to do that:

  • Left click on wamp server icon -> PHP -> PHP extensions and click on php_apc if there is not check mark. Your WAMP server will restart after refresh PHP info page and search for the APC section.
  • Second way to enable php extensions is to open your php.ini file, but be careful the choose correct one. There is one in the php folder and one in the apache folder. Use the second one, which can be found here C:\wamp\bin\apache\apache2.2.22\bin\php.ini. Search for “Windows Extension” at the end of the section add this on new line: “extension=php_apc.dll“. Save the file and restart wamp server.

Now the last step is to have admin page for APC view data, stats, system cache and other options for apc.

    • Go to this page Admin for apc and download as apc.php
    • Save it in your root folder, in my case the path is: C:\wamp\www
    • Open the apc.php with your favorite text editor and change this lanes:
      defaults('ADMIN_USERNAME','apc');    // Admin Username
      defaults('ADMIN_PASSWORD','password');   // Admin Password - CHANGE THIS TO ENABLE!!!
    • Now go to http://localhost/apc.php and you should see a page with status of your cache and useful information

That’s all. Good luck.

Posted in Php, Wamp at July 12th, 2013. 1 Comment.

Eclipse open search result in new window

If you want Eclipse search results to be displayed in different windows, you must uncheck this option:

Preferences > General > Search > Reuse editors to show matches

Posted in Eclipse at June 3rd, 2013. No Comments.

Change GRUB timeout and default option on Ubuntu 12.10

If you use one PC with Ubuntu and other OS, sometimes maybe we need to change timeout of the GRUB before load OS or order of all OS. I will show you how to do that on Ubuntu 12.10
Open terminal /shortcut Ctrl+Alt+T/.
In terminal enter

gksudo gedit /etc/default/grub

Enter your password and you will see grub file in gedit editor.It will be something like that

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
  • GRUB_DEFAULT – default is 0 it corresponding to the first value in the grub menu loader. So for second option is 1, third is 2 and etc. In my case Windows 7 is 5 option in grub menu so I set GRUB_DEFAULT=4
  • GRUB_TIMEOUT – this is the option how many seconds to wait before start loading the selected option. Default value is 10, as you can see upper I change it to 30 seconds.

When you finish with editing save the document and close it. In the terminal enter this command to apply changes that you made.

sudo update-grub

Reboot and you should see your default and timeout options change.

Posted in Linux, Ubuntu at April 16th, 2013. No Comments.

Inserting a text string or paragraph into Zend_Form

If you want to add text after element in form just use description of form element.

textElement = new Zend_Form_Element('someElement'); 

or in the form file:

            'some element',
                'label'         => 'Some element:',
                'description'   => 'TEXT',

If you are wanting something more complex you must define your own decorator.

Posted in Php, Zend Framework at September 27th, 2012. No Comments.

How to convert from gif to jpg with ImageMagick

Hello, today I will show you how to convert gif file to jpg file with ImageMagick. If the gif image is with animation then you can choose from which frame to take the image.

convert -strip test.gif test.jpg

This will create jpg image for every frame in the gif image. If you want to create only one jpg image use same command with frame number from which you want to take image.

convert -strip test.gif[0] test.jpg
convert -strip test.gif[4] test.jpg

The first row will take first frame image, the second row will take from the fifth frame.

That’s all.Good luck.

Posted in ImageMagick at April 10th, 2012. No Comments.

Zend framework MySQL query random records

Hello, sometimes we need a query which will return random rows from table. In your model create this:

    public static function getRandom()
        $model = new self();
        return $model->fetchAll($model->select()

This will return 8 random rows from the table.
The problem with RAND() function is performing slowly. It needs to assign a random id to each row in database table and find a Unique row. For a small amount of rows will be OK to use RAND() function.
And this work only for MySQL.

That’s all for me. Good luck.

Posted in MySQL, Php, Zend Framework at March 28th, 2012. No Comments.

Install APC on Ubuntu 11.04

Installation of APC on Ubuntu 11.04 is simple, only requires two terminal commands:

sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart

After restart create one php file.

echo phpinfo();

Check for the apc module.
Good luck.

Posted in Apache, Php, Ubuntu at December 14th, 2011. 1 Comment.