Opencart system/library/encryption.php on line 8

We discovered this today and thought we would share it to help others find a solution quicker.

We have moved a client using OpenCart from a shared hosting server to a new VPS server.

Moving OpenCart Installation To New Server

  1. Backup current site files to local machine using FTP.
  2. Upload site files to new hosting server using FTP.
  3. Copy Database of current site.
  4. Create a new database on the new server.
  5. Import the database from the backup.
  6. Change the config files to ensure you have the correct information.
    1. DB_HOSTNAME
    2. DB_USERNAME
    3. DB_PASSWORD
    4. DB_DATABASE
  7. Change the config files directory structure information.
    1. DIR_APPLICATION
    2. DIR_SYSTEM
    3. DIR_DATABASE
    4. DIR_LANGUAGE
    5. DIR_TEMPLATE
    6. DIR_CONFIG
    7. DIR_IMAGE
    8. DIR_CACHE
    9. DIR_DOWNLOAD
    10. DIR_LOGS
  8. Edit you local DNS to check the site is working forcing your PC to view the website domain name at the new server.
    1. Edit Hostfile “C:\windows\system 32\drivers\etc\hosts
    2. add server IP ADDRESS ***.***.***.*** and then the domain name with and without www.

Example:-

127.0.0.1 chameleonwebservices.co.uk

127.0.0.1 www.chameleonwebservices.co.uk

Now test the site and hopefully all works.

Error: Opencart system/library/encryption.php on line 8

We got the following error “Fatal error: Call to undefined function mcrypt_create_iv() in /var/www/vhosts/#######/httpdocs/system/library/encryption.php on line 8”

We took a look at the line of code:-

$this->iv = mcrypt_create_iv(32, MCRYPT_RAND);

We then realised the new server had not go mcrypt so we needed to install this.

To do this you will need to login to the server via a program like PUTTY and run the following:-

yum update
yum install php-mcrypt*

We got:-
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.coreix.net
No package php-mcrypt available.

This did not work due to the package not being available so we had to use:-

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/php-mcrypt-5.3.3-3.el6.x86_64.rpm
yum local install php-mcrypt-5.3.3-3.el6.x86_64.rpm

Now we get:-

Loaded plugins: fastestmirror, security
Setting up Local Package Process
Examining php-mcrypt-5.3.3-3.el6.x86_64.rpm: php-mcrypt-5.3.3-3.el6.x86_64
Marking php-mcrypt-5.3.3-3.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* extras: mirror.sov.uk.goscomb.net
* updates: mirrors.coreix.net
Resolving Dependencies
–> Running transaction check
—> Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php-mcrypt x86_64 5.3.3-3.el6 /php-mcrypt-5.3.3-3.el6.x86_64 46 k

Transaction Summary
================================================================================
Install 1 Package(s)

Total size: 46 k
Installed size: 46 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-mcrypt-5.3.3-3.el6.x86_64 1/1
Verifying : php-mcrypt-5.3.3-3.el6.x86_64 1/1

Installed:
php-mcrypt.x86_64 0:5.3.3-3.el6

Complete!

You will then need to restart your server:

service httpd restart

Now check the website and it should be up and running.

Web Hosting & Coding Effects Website Speed

We have been carrying out analysis over the last few days looking at hosting speed and code ensuring that we are using the best methods to build sites to help increase the speed of the Internet.

This analysis started life with this post “The Web Should Be Fast” which we published 4th November 2014.

We have been looking deeper into the realms of speeding up the way websites are delivered and looking for small improvements to help serve site files better.

Increase The Speed Of Your Website

There are various ways to increase the speed of your website and this starts at the hosting level. The hosting should be the correct level of hosting to serve the purpose and as an example a shared hosting costing £3.99 per month running a Magento website is going to be slow and not only will this website be slow, but probably every other website on the same hosting server.

If you require a website to be responsive and the platform is heavy such as Magento then you need to purchase hosting that is designed to cope and this will increase costs, but generally speaking the costs are small. OpenCart is a good platform that uses less resources and we have seen huge sites built on this platform be very quick on affordable hosting.

If you are using WordPress then shared hosting is fine due to WordPress being light on the resource requirements. With platforms like WordPress there are various plugins that can really help increase speed using things like W3 Total Cache or WP Super Cache. These both are used as WordPress Performance Optimization (WPO) frameworks that have been designed to improve page speed using Mod_Rewrite and Caching. This is the fastest method of serving pages using Apache mod_rewrite making websites load much quicker and thus improve the user experience.

W3 Total Cache and WP Super Cache Benefits:

  • Users have seen 10x improvement in overall site performance when fully configured
  • Improved conversion rates
  • “Instant” subsequent page views: browser caching
  • Optimized progressive render: pages start rendering quickly
  • Reduced page load time: increased visitor time on site; visitors view more pages
  • Improved web server performance; sustain high traffic periods
  • Up to 80% bandwidth savings via minify and HTTP compression of HTML, CSS, JavaScript and feeds

Website Server Speed Testing

We carried out testing comparing Facebook, Microsoft, Adobe, Ebay, Apple & AOL and since this testing we have carried out a couple of tweaks to improve things and we have re-tested and the results are pretty amazing.

Facebook, Microsoft & Adobe Hosting Speed & Coding Test Results:-

The testing is using the following URLs www.chameleonwebservices.co.uk, www.facebook.com, www.microsoft.com & www.adobe.com.

Web Hosting Speed Testing

Web Hosting Speed Testing

The results of this latest test show we have really stood strong against the tough competition.

We still needed to compare against Ebay, Apple and AOL to see how we do this time.

Ebay, Apple & AOL Hosting Speed & Coding Test Results:-

The testing is using the following URLs www.chameleonwebservices.co.uk, www.ebay.com, www.apple.com & www.aol.com.

Web Hosting Speed Test

Web Hosting Speed Test

These test results are great for us and we can be proud of what we have achieved.

Hosting Speed & Coding Test using GT Metrix

 

JEdit Java Editor Review

jedit logoOver ten years ago it was created, Java the write once, run it anywhere programming tool which has really helped web developers across the globe.

We have been using Java in house for years and found that the JEdit text editor for programmer’s is one of the very best examples of what Java was setup for, the cross-platform editor works amazing.

Those that use the Eclipse editor, another java based open source programming tool will be using this with the additional plugins available and be very happy with the performance, but often they will not even be aware of JEdit at all and both are very similar.

JEdit is aimed at coders and can be converted to be a complete integrated development environment with the right plugins and become one of the most amazing editor programs available with compiling, code completion and simple debugging made simple and there are other added functions that can be added quickly making this so valuable to all who use it.

For our programmers working with various open source languages such as PHP, Python and Perl using JEdit is like having a swiss army knife ready for your ever need. Adding extra functionality is simple with the readily available plugins and this makes code parsing for example simple.

jedit screenshot

The user interface provides dual or tri-platform development, with a portable working environment.

You only have to learn one interface for use in different situations on different operating systems making this the best available editor we use.

Why not try it for yourself: DOWNLOAD

Is there a difference between the “strong” and “b” tags in terms of SEO?

Hi Matt, In terms of SEO, what is the difference between strong tag and bold tag for emphasis on certain words of text. From the user perspective, both tags have the same effect (words in bold). Which tag should we use, in which circumstances?
Jean-Marc G, Paris, France

How To Fix Magento Admin 404 Error

If you are having a problem with the Magento admin area showing a 404 error then this maybe due to many things.

If you have moved the site to a new server then this is normal as Magento requires you to delete the session temporary files and run a query on the database.

Using an FTP client go the folder location /var/

Now remove the content of the following:-

  • Cache
  • Session
  • Tmp

Confirm you have the database configuration correctly setup which is located at /app/etc/

Here you have config.xml and local.xml

Now open the database using a Database client.

  • Go to your database
  • Select the main table over area
  • Run the following SQL Query:

 
SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

You should get the result:-

[SQL]
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code=’NOT LOGGED IN’;
Affected rows: 1
Time: 0.036ms

[SQL]
SET FOREIGN_KEY_CHECKS=1;
Affected rows: 0
Time: 0.033ms

Now try going to your admin area.

If you are still having issues then try www.domainname.co.uk/index.php/admin