Hosting on CentOS 7 now

Moved distro again because I somehow managed to break MariaDB on Ubuntu.. So instead I’m back to Percona on CentOS, which I upgraded to v7 now. Mind you I am not running HHVM anymore so the site will be slower. Turns out there’s a memory leak when it comes to Crayon, the syntax highlighting plugin I use. I have to look for a nice caching solution, preferably using Redis..

UPDATE: Found my redis solution! https://github.com/BenjaminAdams/wp-redis-cache
Without being logged in the blog loads in 13ms now, that’s even faster than varnish :)

Magento create slug

MU-SlugCreating a Magento slug from any type of string or bunch of words is really easy. Magento has a few built in functions to deal with just that and they take any type of character as input.

As described by Wikipedia:

Some systems define a slug as the part of a URL which identifies a page using human-readable keywords.[4][5] It is usually the end part of the URL, which can be interpreted as the name of the resource, similar to the basename in a filename or the title of a page. The name is based on the use of the word slug in the news media to indicate a short name given to an article for internal use.

Slugs are typically generated automatically from a page title but can also be entered or altered manually, so that while the page title remains designed for display and human readability, its slug may be optimized for brevity or for consumption by search engines. Long page titles may also be truncated to keep the final URL to a reasonable length.

Slugs are generally entirely lowercase, with accented characters replaced by letters from the English alphabet and whitespace characters replaced by a dash or an underscore, in order to avoid being encoded. Punctuation marks are generally removed. For example:

Original title: This, That & the Other! Various Outré Considerations
Generated slug: this-that-other-various-outre-considerations

At work we even use it to generate CSS classes since they are also safe in that aspect. I have copied it into a simple function, since I used it for an import script but if you are just working in Magento itself you can of course just call the Mage:: line by itself.

Class undefined: Mage_Googlecheckout_Helper_Data

t-google-404-1299071983This is a common problem you will experience after updating Magento past 1.7.0.2. There are a few Google Checkout files which are not necessary anymore and if they still exist Magento will spit out an error (and possibly a white screen) after the update. I usually find the error in system.log and it usually looks like this:

This has been documented in the knowledgebase here:

http://www.magentocommerce.com/knowledge-base/entry/ce-18-later-release-notes

The sollution is quite simple, go to the following directory and delete all the files EXCEPT config.xml:

So that should be the following files:

After deleting those files your admin pages should work again. You might have to clear your cache as well.

Working Drupal 7 Nginx Configuration

This config is working for me including regeneration of style images after being flushed.

Nginx timeout + PHP-FPM/HHVM

In case you are searching for why you can still get a 504 gateway timeout when you have already increased max_execution_time in php.ini: try adding this to your fastcgi_params file:

UPDATE: Turns out this was also happening when we were running an Nginx + HHVM server. Of course I went searching for a max_execution_time value but as far as I could tell HHVM doesn’t have that and it turned out to be this nginx timeout once again.