Install PHP mcrypt on UNIX server

Install PHP mcrypt on UNIX server

In this quick tip I’ll show you how to install the PHP extensionmcrypt. This is needed for Magento to run properly otherwise you’ll get an error like: 1Fatal error: Call to undefined function mcrypt_create_iv() in lib/Varien/Crypt/Mcrypt.php on line 64 Install mcrypt on Ubuntu 12# apt-get install php5-mcrypt # /etc/init.d/apache2 restart Install mcrypt on CentOS 12345## 64 […]

Read full storyComments { 0 }
SQL: Remove HTML with procidure

SQL: Remove HTML with procidure

I had a problem with client’s data that was saved as HTML in the database and I needed it in plain format. Many would say this is very inefficient way of doing it but sometimes desperate time call for desperate measures. And here is my solution to the problem: 123456789101112131415161718192021222324SET GLOBAL log_bin_trust_function_creators=1; DROP FUNCTION IF […]

Read full storyComments { 0 }
How to Move Magento to a New Server or Domain

How to Move Magento to a New Server or Domain

Magento is one of the fastest growing eCommerce platforms on the internet and with its recent acquisition by eBay it promises to stay on the lead and keep growing with even faster pace than before.  It’s been choice for a platform for many of my clients and recently I had to do some development work […]

Read full storyComments { 0 }
Magento: How to reset admin pssword

Magento: How to reset admin pssword

If you forget your admin password for Magento and you can’t remember the email or just want quick fix you can use one line of SQL to sort that issue out. 1UPDATE admin_user SET password=CONCAT(MD5(’qXpassword’), ‘:qX’) WHERE username=’admin’; All you have to do is replace the “password” with your required one and run the query.

Read full storyComments { 0 }
Serve main domain from subdirectory with .htaccess

Serve main domain from subdirectory with .htaccess

If you are running your site on a shared hosting and you have multiple domain installed as subdirectories the things could go out of hand really fast. In my specific case I have multiple installs of different CMS and one main domain running from “root” directory. What I wanted was to be able to run […]

Read full storyComments { 0 }
How to read STDIN with PHP script from terminal

How to read STDIN with PHP script from terminal

In console environment PHP could be very useful especially running long tasks or for CRON jobs. You can execute your script like: 1php scriptName.php You can also pass some parameters like: 1php scriptName.php param1 param2 Those can be retrieved through a PHP variable which accessible only in console mode called $argv 12$param1 = $argv[1]; $param2 […]

Read full storyComments { 0 }
Migrate Prestashop to another server

Migrate Prestashop to another server

If you need to migrate a PrestaShop website from a local to a remote installation or just change the domain name, you need to follow these steps: 0. For security reasons, make a backup of all files and database 1. Upload all files to new hosting via FTP 2. Import the database using the phpMyAdmin […]

Read full storyComments { 2 }
HTTP cache control on a dynamic PHP page

HTTP cache control on a dynamic PHP page

In the general case the website caching happens on the server side where the PHP output or database objects are cached in static files or in the server RAM. That could work pretty good but we could improve that and add one extra layer and more specifically define HTTP header for cache control so to […]

Read full storyComments { 0 }
Joomla! 3: Ready for the Mobile Web

Joomla! 3: Ready for the Mobile Web

The Joomla! This week the Joomla Project has all anticipated! 3 released. With the latest addition to the family many hopeful expectations are linked.Whether Joomla! 3.0, this will meet as expected, will show in the coming months. Experienced Joomla! Users know – as always when it was “great” or “New” in the Joomla! To celebrate community, there is also confusion. That is […]

Read full storyComments { 0 }
Magento white screen or how XML can break your site?

Magento white screen or how XML can break your site?

I had an odd white screen on one of my websites. No exceptions, no messages, it was time to check the error log. There I found the following error: PHP Fatal error: Call to a member function extend() on a non-object in httpdocs/lib/Varien/Simplexml/Config.php on line 600 That looked very scary like there was some mess […]

Read full storyComments { 0 }