Handling Hungarian character set from PHP – Ő Ű problem

I have started to write an app in php and run into the good old character set problem.Ő and Ű characters were not displayed correctly however I have converted the data back and forth. The key is to use UTF-8 encoding.

You have to tell php what encoding to use you can achieve this either using the HTML or the PHP definition. Whichever suits you. Add this to the header section of the HTML code:

<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″ >

You can achieve the same using the header php command:

header(“Content-Type: text/html; charset=utf-8”);

Now we have to make sure that the data coming from the mysql database is UTF-8 encoded. Add this right after the database connection line.

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); // Add UTF-8 converting after this line
mysql_query(“SET NAMES UTF8”);

Make sure that the php file itself is saved from the editor in UTF-8 format. Each progamming editor has the capability to change the character encoding.

Finally check your database if  the tables and the database are utf8_hungarian_ci encoded. MySQL connection collation should be set to utf8_general_ci.

That should be it 🙂

Google Base Feed partly uploads – Prestashop

I am using www.ecartservices.net’s Google Base feed generator. I ran into a problem last week. I have over 5000 products in one of my store. The feed was generated fine however when I am uploading to Google Base only loads about 1000 of them. I was trying to find out what went wrong but I couldn’t figure out what order the products were uploaded to see what’s wrong with the feed file. I have just figured out that the feed generator assigns an id to every product and Google Base indexes the products in that order. So if you have the same problem find out what part of the feed file is corrupted follow these steps:

Check how many products have been uploaded successfully using Google Merchant Center’s “feed” option:

In my case 1009 products are indexed correctly. To find out what went wrong open your generated XML feed and find the relevant id.

<item>
<title>CAESARS by Caesars</title>
<g:brand>Caesars</g:brand>
<g:condition>new</g:condition>
<description><![CDATA[Gift Set — 3.3 oz Eau De Cologne Spray + 3.3 oz Body Cream + 3.3 oz Body Wash]]></description>
<g:expiration_date>2010-10-22</g:expiration_date>
<g:id>pcen-1009</g:id>
<guid>pcen-1009</guid>
<g:image_link>http://www.megaperfumeshop.com/img/p/1009-1009-large.jpg</g:image_link>
<link>http://www.megaperfumeshop.com/1009-caesars-by-caesars.html</link>
<g:price>38.4</g:price>
<g:product_type>Brands A-Z &gt; Caesars</g:product_type>
</item>

Then see the next product:

<item>
<title>caf&iuml;&iquest;&frac12; by Cofinluxe</title>
<g:brand>Cofinluxe</g:brand>
<g:condition>new</g:condition>
<description><![CDATA[Parfum De Toilette Spray 3 oz]]></description>
<g:expiration_date>2010-10-22</g:expiration_date>
<g:id>pcen-1010</g:id>
<guid>pcen-1010</guid>
<g:image_link>http://www.megaperfumeshop.com/img/p/1010-1010-large.jpg</g:image_link>
<link>http://www.megaperfumeshop.com/1010-caf-by-cofinluxe.html</link>
<g:price>16.64</g:price>
<g:product_type>Brands A-Z &gt; Cofinluxe</g:product_type>
</item>

The junk characters in the product name cause the feed import to stop and not to load products any further. Simply remove the defected products and upload the feed again. So this wasn’t the problem of the feed generator but it was a problem with the data quality. Good stuff that it can easily be fixed.

Refurbishing of iranyspanyolorszag.com

We are currently refurbishing the www.iranyspanyolorszag.com page. We are changing the profile from a community website to more tourism based one adding loads of information however keeping part of the information of the previous page. We also migrated the site from joomla into wordpress giving it a fresh look and better navigation.

How to change a wordpress site’s URL

I recently had to copy over to solutioning.eu this blog from blog.solutioning.eu. I read many articles and it was really confusing. Since the database was already on the same server and the username/ password hasn’t changed once I copied all the files the site was running but there were no styles whatsoever so it looked a bit dodgy. Also the wp-admin link wasn’t working. This is due to the fact that wordpress stores the site’s URL in its database ( not like joomla or prestashop which have this defined in a configuration file ).

I could change the URL by simply changing the following in the wordpress database using PhpMyAdmin:
I opened the wp_options table and changed the siteurl and home fields to www.solutioning.eu from blog.solutioning.eu

The website was working again right after this, no hassles, not other configurations…

Windows 7 Install – Cannot Find DVD Driver Solution

I bought new hardware a week ago and I decided to try windows 7 64bit. After putting it all together I tried to install Windows 7 which was going for a while then it started to complain about the DVD Driver and the installation process stopped. This error usually happens when you have an old DVD drive which is no longer supported by Windows 7 64bit. Well I have a 5 year old Benq DW1620 DVD drive. After browsing the forums and finding no useful information on this apart from buying a Windows 7 compatible DVD Driver I decided to try a different approach: Installing Windows 7 from a USB key.

This magically solved the installation problem and the DVD drive is now working properly under Windows 7 without any additional tweaking.

To install Windows 7 from a USB key follow this guide

Please watch out for the following things while using this guide:

  • If you use XP the diskpart utility will NOT show your USB keys. So instead of doing it from diskpart you can complete the relevant steps from the Disk Manager. The easiest to start the Disk Manager: Click Start > Run and type diskmgmt.msc in the Open line and click OK. The Disk Management snap-in will open.
  • If you do not have the relevant bootsect.exe ( 32 bit version for 32 bit Windows 7 and 64bit version for 64bit operating system ) you will not be able to create the bootdisk. To fix this download the relevant version of bootsect.exe.

Gigabyte h55m-ud2h struggles, problems, solutions and that

Installing the Motherboard

I have recently purchased Gigabyte h55m-ud2h motherboard as part of an upgrade kit. First of all the motherboard came with only 2 cables ( IDE, SATA ) so if I wouldn’t have cables like this lying around I wouldn’t have been able to connect my 3 SATA disks. I do not know if this is because it was part of the upgrade kit or the motherboard comes with these 2 cables by default but it is nowhere near sufficent.

The motherboard is very compact, needless to say that I couldn’t properly fit it to my 5 year old large chassis. The holes on the chassis simply were not on the right place for this motherboard… I managed to fit most of the screws though apart from those at the far end of the motherboard. So I had to be extra careful when I installed the memory modules not to break the motherboard. Apart from this problem and that I didn’t find my screwdriver kit for a while 🙂 it was very easy to install.

The Motherboard has the following built in stuff:

Built in Audio

Proper drivers for Windows 7 64bit
Detected by Ubuntu 9.04, 9.10 OK

Built in VGA H55 ( jaysus!!! )

This has been advertised as some superfast video. Well folks .. to put it mildly it is dreadful. Terrible graphics performance, and very ugly rendering. You definitely will need an additional video card if you plan to play games on it. Even World of Warcraft is terribly flickery so I had to set the graphics option way back.

The most annoying thing is that I wasn’t able to video card I have integrated and in fact I haven’t been able to determine it until I installed the drivers that came with the motherbord installation cd.

The videocard shows up in the windows device manager as: Intel (R) Graphics Media Accelerator HD

This actually not saying much, no model number or anything so it will be a bit of a w*nk to get the latest drivers downloaded 🙂

Video Driver Windows 7 64 Bit

The video driver is OK for windows

Video Driver Ubuntu 9.04, 9.10

Update: The driver works perfectly on 10.04 LTS and it installs automatically

Now this is a problem. When I started up Ubuntu 9.04 it didn’t recognize the video and to add a bit more drama to the situation the screen was shifted left on the monitor. I spend numerous hours trying to fix this problem but I never got to fix it on this Ubuntu version.

I tried to remove the previous Nvidia drivers – No Luck
I tried to download new intel drivers – Was already the latest
Upgraded to Kernel 2.6.30 as explained here – No Luck

Finally I decided to stop trying as I read on some forums that Ubuntu 9.10 is running fine this videocard so I kicked off an upgrade.. which to be honest with you was one of the smoothest operating system upgrade I ever had. Needless to say that it wasn’t working correctly on 9.10 neither. In fact the operating system did hang right after login.

Upgraded the kernel to the latest which is 2.6.32 at the time of writing but this again didn’t solve anything it was hanging after log in like kernel 2.6.31.

The lucky thing was that the kernel 2.6.30 was still installed and was working even though the screen was shifted. I logged in to it and removed any trace of any Nvidia product installed over Ubuntu.

After a restart all 3 installed kernels started to work but the sceen was shifted for all of them.. that was better than not being able to log in at all. I have defined the third party auto upgrade option found here then reinstalled some Nvidia stuff ( I was all over the place so I haven’t a clue which ones ) and voila it started to work on kernel 2.6.31, 32… the 2D part 3D part still doesn’t work. As I am not using Ubuntu for gaming at all I decided not to bother with fixing the 3D any longer.

Built in LAN

Detected by Windows 7 OK
Detected by Ubuntu 9.04, 9.10 OK

The bios menu is generally good apart from the fact that I do not see any option to disable the built in VGA… well I hope when I get myself a proper graphics card it will not interfere with it.

The other thing is if you want to boot from an USB key it detects it as a hard drive so when you go to the boot menu and select from the numerous USB options (USB Disk, USB FDA, etc ) none of them will be your USB key. To fix this just go to the Bios and select the USB key from the Hard Drive Priority option ( needs more exact explanation ).

To summarize my experience with h55m-ud2h well after spending a few days on fixing the above errors it works all right. If you have a bunch of cables already you can go ahead and buy it… but do not forget to get a proper graphics card.

Gigabyte H55M-UD2H official page

Preparing a joomla test environment on Ubuntu for existing Joomla site

You will need to install following to prepare a test environment on Ubuntu for Joomla:

Install Apache Web Server:
sudo apt-get install apache2

Install PHP5:
sudo apt-get install php5

Install PHP Apache libraries:
sudo apt-get install libapache2-mod-php5

Restart Webserver:
sudo /etc/init.d/apache2 restart

Instal MySQL Server:
sudo apt-get install mysql-server

Install PHP Module for MySQL5:
sudo apt-get install php5-mysql

Installing phpMyAdmin:

Download latest package from

  • http://www.phpmyadmin.net/
  • Create a directory phpmyadmin in your web server root ( usually it is /var/www )

    Create the config directory in /var/www/phpmyadmin/

    Change permissions on config:
    sudo chmod 777 /var/www/phpmyadmin/config

    Open the following page in a browser http://localhost/phpmyadmin/setup/install.php

    Add your server configration and save the config file

    Install Mcrypt:
    sudo apt-get install php5-mcrypt

    Restart apache server:
    sudo /etc/init.d/apache2 restart

    Open the following page in a browser http://localhost/phpmyadmin/index.php

    Remove config directory from /var/www/phpmyadmin/

    Install MySQL Admin:
    sudo apt-get install mysql-admin

    Create and Download latest cpanel backup from your host.

    Create a directory in /var/www/ which will contain your website.
    copy the joomla files from the backup file to the directory what you have created remember you should copy your site’s document root
    Open configuration.php and modify the following values:

    $mosConfig_absolute_path = ‘/var/www/[directory what you have created]’;
    $mosConfig_cachepath = ‘/var/www/[directory what you have created]/cache’;
    $mosConfig_live_site = ‘http://localhost/[directory what you have created]’;

    Note the value of these 3 variables:

    $mosConfig_db <- This will be the MySQL database associated with your website. $mosConfig_user <- This will the MySQL user. $mosConfig_password <- This will be the password for your MySQL user. Now it is time to create the MySQL database from the backup. Look for the database SQL file in the backup. The filename should be the same as the database name so it would be something like [database name].sql.

    Now start the MySQL admin graphical interface: ./mysql-admin
    After logging in click on Restore Backup the click on Change Path to select the path to your MySQL backup file

    Select the mysql backup file, select the relevant encoding and create a New Schema for your database. This should be the same as your database name.
    Click on Restore Backup

    Once the backup is restored create the database user id and password, and grant all rights to the database for this user.

    ITM/TEPS – How to fix excessive Navigator tree rebuilding – Agents appearing/disappearing constantly

    I have recently run into this problem. The navigator tree was rebuilding/changing constantly resulting the TEPS Console to be nearly unusable. To fix this I set the following variables in cq.ini ( TEPS ini file location under $CANDLEHOME/config/)

    KFW_CMW_DETECT_AGENT_ADDR_CHANGE=N

    The Navigator function detects when the IP address for an agent is discovered. If the agent environment is constantly changing or has improper configurations that generate excessive Navigator tree rebuilding, consider adding this environment variable to have any discovery of changes or additions of IP address ignored.

    KFW_CMW_DETECT_AGENT_HOSTNAME_CHANGE=N

    This variable is like the one for detect agent address change except that it prevents the Navigator rebuilding if an agent hostname is changed.

    KFW_CMW_DETECT_AGENT_PROPERTY_CHANGE=N

    This is like the detect agent address change except that it prevents the Navigator rebuilding if an agent affinity or affinity version changes.

    References/Documentation on TEPS environment variables:

    http://publib.boulder.ibm.com/infocenter/tivihelp/v24r1/index.jsp?topic=/com.ibm.itm.doc_6.2.fp1/itm_admin52.htm

    [ad#Google Adsense-1]