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 [...]
Install PHP mcrypt on UNIX server
by SANDO on 24. Nov, 2012 in Apache, CentOS, PHP, Servers, Small Tips
SQL: Remove HTML with procidure
by SANDO on 24. Nov, 2012 in Small Tips, SQL
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 [...]
Magento: How to reset admin pssword
by SANDO on 24. Nov, 2012 in Magento, Small Tips, SQL
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.
Serve main domain from subdirectory with .htaccess
by SANDO on 19. Nov, 2012 in Apache, Servers, Small Tips
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 [...]
Magento white screen or how XML can break your site?
by SANDO on 02. Oct, 2012 in Magento, Small Tips
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 [...]
MySQL – Delete/Drop all tables with specific prefix
by SANDO on 22. Sep, 2012 in Small Tips, SQL
MySQL is great database especially for small and mid size web applications. You can do loads of stuff with it but not everything is possible with regular SQL query. Imagine you have a database and you want to delete set of tables. Most of the database, if not all, I create I use table prefix [...]
PHP Type Checking
by SANDO on 13. Sep, 2012 in PHP, Small Tips
Here’s a quick and dirty utility method for type checking an object or an array of objects. /** * Ensure the object (or the first item in the * array of objects) is of the specified type * or throw an exception * @static * @throws Exception if wrong type * @param $object_or_array * @param [...]
Force M$ document’s extension and MIME type through .htaccess
by SANDO on 28. Aug, 2012 in Apache, Servers, Small Tips
The problem If you use MacOS and Chrome browser (recently this has been reported under other browsers and OS as well) you might have experienced an issue when downloading any Microsoft documents like Word, Excel, PoerPoint their file extension is automatically swapped to “.zip”. The reason for that are the server configurations and more specifically [...]
Prevent caching of XML files with Apache .htaccess rules
by SANDO on 23. Aug, 2012 in Apache, Servers, Small Tips
I am having problems with a dynamically created images.xml being cached in internet explorer. The xml file is used by a flash slideshow player and for different pages on the site, has different images to show. IE isn’t reading the new images.xml each time. I had a go at adding some cache control code to [...]
Source Code -> Iframe with 100% Height
by SANDO on 23. Aug, 2011 in CSS, JavaScript, Small Tips
Ever wonder how to create an iframe that fills the entire height (and width) of a page? You probably tried writing something like: 1<iframe width="100%" height="100%"></iframe> and expected the iframe to fill up whatever it could. The width=100% does what you expected and fills up the entire width of the page, but the height just [...]
Categories
- CMS (6)
- Joomla (2)
- Magento (3)
- PrestaShop (1)
- CSS (3)
- HML5 (1)
- JavaScript (3)
- jQuery (1)
- PHP (8)
- CakePHP (1)
- Plugins (1)
- OOP (1)
- Zend Framework (1)
- CakePHP (1)
- Servers (7)
- Small Tips (15)
- SQL (3)
Quotes
When inspiration doesn’t come to me, I go halfway to meet it
— Sigmund Freud
-
CakePHP – User authentication and registration 19. Mar, 2011 -
HTML5 and pushState 17. Jul, 2011 -
Source Code -> Iframe with 100% Height 23. Aug, 2011 -
Htaccess – redirect domain to WWW 19. Mar, 2011 -
Migrate Prestashop to another server 08. Nov, 2012
-
Install PHP mcrypt on UNIX server 24. Nov, 2012 -
SQL: Remove HTML with procidure 24. Nov, 2012 -
How to Move Magento to a New Server or Domain 24. Nov, 2012 -
Magento: How to reset admin pssword 24. Nov, 2012 -
Serve main domain from subdirectory with .htaccess 19. Nov, 2012
-
SANDO: @frodito I've updated the post, but briefly, make ...
-
frodito: I understand everything except for #6... how I do ...
-
Chris Dean: Excellent Write-up, Thanks a lot...
-
QNUPS: Yin Yang Source! Excellent!!...
-
seo campaign plan: Always pleasant to find a new blog this great! I w...
