Moving Magento site from development server to live server

Recently I faced problem to move magento site from local (LAMP) environment to web server. I am posting steps to upload site on server.

1. Make tar / zip of code.

$ tar -cvvf site.tar /opt/lampp/magento/

2. Take backup of database through phpmyadmin. Check “Disable foreign key checks” to avoid error in restore process.

3. Open backup sql file and add following

In beginning

SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=’NO_AUTO_VALUE_ON_ZERO’;
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

and following in the end of file

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;

4. Upload tar / zip file on web server, extract and deploy. Don’t forget to clear cache (Clear /var/cache and /var/session directories).

tar -xvvf site.tar

5. Change /var permission to 777 recursively.

$ chmod 777 /home/magento/htdocs/var

6. Restore database on server through phpmyadmin.

7. Change mysql database setting in

/app/etc/local.xml

<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[database_username]]></username>
<password><![CDATA[database_password]]></password>
<dbname><![CDATA[database_name]]></dbname>
<active>1</active>
</connection>

8. Run website.

If you are getting blank page then check the following

1. Mysql Database setting.

2. Did you clear cache?

3. Followed step3?

If you are getting Undefined index 0 Error then check the following

1. Did you followed step3?

2. Or you can manually run these queries

UPDATE `magento`.`core_website` SET `website_id` = ‘0’ WHERE `core_website`.`code` = ‘admin’  LIMIT 1 ;

UPDATE `magento`.`core_store` SET `store_id` = ‘0’ WHERE `core_store`.`code` = ‘admin’ LIMIT 1 ;

Clear cache as you make any change.

GPS Navigation in India

Hi, yesterday I searched for GPS softwares for my Nokia 5800, I came across many providers. Here is a list of GPS providers for indian cities.

Among these solution I liked Google Latitude most. Google Latitude is free and have good coverage in India. I am using this for Chandigarh. It has My Location, Driving direction support for Chandigarh.

You can download it from here : http://www.google.com/intl/en_us/latitude/intro.html

The best feature of latitude is, track your friend’s locaiton on web (iGoogle). You can select your friends to view your current location. This application automatically activate backgroung services which update your location automatically on server.

Screenshot

Although this has serious privacy issue, but you can always control this feature in privacy  setting. You can turn it on / off, block friend to watch your location etc.

screen4-large

This application is very useful to parents. They can get current location of there children. Overall this is very good and free solution available. This application is available for varity of phones.

Top of all this provide GPS service for non GPS handset also. You wonder how? Checkout this video from google.

Its worth to try it out.

Path variables in PHP

Many of you develop php applications for multiple server environment. Webserver environment may be different, have different directory structure, so you have to use paths very carefully. For example in file upload script, you manually write absolute path of image directory, the application may not work on other server. To avoid this you should use inbuilt php path variables. I am posting summary of all php related path variables.

Operation: Extract file name from path
Function: string basename ( string $path  [, string $suffix  ] )
Example:
$path = /opt/lampp/htdocs/demo/test.php;
echo basename($path);
Output: test.php

Operation: Get web server root path
Variable: $HTTP_SERVER_VARS[“DOCUMENT_ROOT“]
Example:
echo $HTTP_SERVER_VARS[“DOCUMENT_ROOT“];
Output: /opt/lampp/htdocs

Operation: Get current script full path (including document root path)
Code: $HTTP_SERVER_VARS[“SCRIPT_FILENAME“]
Example:
echo $HTTP_SERVER_VARS[“SCRIPT_FILENAME“];
Output: /opt/lampp/htdocs/test.php

Operation: Get current script name (relative to root)
Variable: $HTTP_SERVER_VARS[“PHP_SELF“]
Example:
echo $HTTP_SERVER_VARS[“PHP_SELF“];
Output: test.php

Operation: Get current script name (relative to root)
Variable: $HTTP_SERVER_VARS[“PHP_SELF“]
Example:
echo $HTTP_SERVER_VARS[“PHP_SELF“];
Output: test.php

Operation: Convert relative path to absolute path
Function: string realpath ( string $path  )
Example:
echo realpath(‘../images’);
Output: /opt/lampp/htdocs/images

Operation: Get all file details
Function: mixed pathinfo ( string $path  [, int $options= PATHINFO_DIRNAME | PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME  ] )
Example:
$info = pathinfo($_SERVER[‘PHP_SELF’]);
print_r($info);
Output:
Array
(
[dirname] => /abhi
[basename] => EmptyPHP.php
[extension] => php
[filename] => EmptyPHP
)

Swine flue GOVERNMENT AUTHORIZED HOSPITALS – India

image001

SYMPTOMS

  • fever, which is usually high, but unlike seasonal flu, is sometimes absent
  • cough
  • runny nose or stuffy nose
  • sore throat
  • body aches
  • headache
  • chills
  • fatigue or tiredness, which can be extreme
  • diarrhea and vomiting, sometimes, but more commonly seen than with seasonal flu.

Signs of a more serious swine flu infection might include pneumonia and respiratory failure

GOVERNMENT AUTHORIZED HOSPITALS FOR TREATMENT OF SWINE FLU

City Hospital Address Contact
Chennai King Institute of Preventive Medicine (24/7 Service) Guindy, Chennai – 32 (044) 22501520, 22501521 & 22501522
Communicable Diseases Hospital Thondiarpet, Chennai (044) 25912686/87/88, 9444459543
Government General Hospital Opp. Central Railway Station, Chennai – 03 (044) 25305000, 25305723, 25305721, 25330300
Pune Naidu Hospital Nr Le’Meridian, Raja Bahadur Mill, GPO, Pune – 01 (020) 26058243
National Institute of Virology 20A Ambedkar Road , Pune – 11 (020) 26006290
Kolkata ID Hospital 57,Beliaghata, Beliaghata Road , Kolkata – 10‎ (033) 23701252
Coimbatore Government General Hospital Near Railway Station,
Trichy Road, Coimbatore – 18
(0422) 2301393, 2301394, 2301395, 2301396
Hyderabad Govt. General and Chest Diseases Hospital , Erragadda, Hyderabad (040) 23814939
Mumbai Kasturba Gandhi Hospital Arthur Road, N M Joshi Marg, Jacob Circle , Mumbai – 11 (022) 23083901, 23092458, 23004512
Sir J J Hospital J J Marg, Byculla, Mumbai – 08 (022) 23735555, 23739031, 23760943, 23768400 / 23731144 / 5555 / 23701393 / 1366
Haffkine Institute Acharya Donde Marg, Parel, Mumbai – 12 (022) 24160947, 24160961, 24160962
Kochi Government Medical College Gandhi Nagar P O, Kottayam – 08 (0481) 2597311,2597312
Government Medical College Vandanam P O, Allapuzha – 05 (0477) 2282015
Taluk Hospital Railway Station Road , Alwaye, Ernakulam (0484) 2624040  Sathyajit – 09847840051
Taluk Hospital Perumbavoor PO , Ernakulam 542 (0484) 2523138  Vipin – 09447305200
Gurgaon &
Delhi
All India Institute of Medical Sciences (AIIMS) Ansari Nagar, Aurobindo Marg Ring Road , New Delhi – 29 (011) 26594404, 26861698 Prof. R C Deka – 9868397464
National Institute for Communicable Diseases 22, Sham Nath Marg,
New Delhi – 54
(011) 23971272/060/344/524/449/326
Dr. Ram Manohar Lohia Hospital Kharak Singh Marg,
New Delhi – 01
(011) 23741640, 23741649, 23741639
Dr. N K Chaturvedi
9811101704
Vallabhai Patel Chest Institute University Enclave, New Delhi- 07 (011) 27667102, 27667441, 27667667, 27666182
Bangalore Victoria Hospital K R Market, Kalasipalayam, Bangalore – 02 (080) 26703294  Dr. Gangadhar – 94480-49863
SDS Tuberculosis & Rajiv Gandhi Institute of Chest Diseases Hosur Road, Hombegowda Nagar, Bangalore – 29 (080) 26631923  Dr. Shivaraj – 99801-48780


STAY ALERT! PREVENT AGAINST SWINE FLU

VISA MasterCard SecureCode

The Reserve Bank of India (RBI) has mandated that from 1st Aug 2009 all online credit card transactions require an extra level of verification. Your credit card issuing banks are therefore, implementing a “Verified by VISA” or “MasterCard SecureCode” password. You will need this password to continue transacting online from 1st Aug 2009.
What is the “Verified by VISA”/”MasterCard SecureCode” password?
This is the password that your credit card issuing Bank provides. This password is the additional layer of security for all your online transactions.

Benefits of “Verified by VISA”/”MasterCard SecureCode” password
Even if you lose / misplace your credit card it cannot be misused online as the password is not present on the card.

Remember:
Keep your password safe.
Do not share your password with anyone

Apply Here

Source: eBay.in

Installing a minimal Debian system

lennybanner_indexed

I am making this post for users with limited computer resources/old machines. Users with newer and faster machines may also try this if they want their completely customized operating system.

I must also clarify that I personally don’t like bloatwares like Windows Vista etc.

Take my example, when I first installed Ubuntu on my desktop, I had a complete GNOME desktop with many applications pre-installed which I had no use for! So, I started uninstalling that bloat from my system to make my OS slim so that it can run properly on my good ol’ pentium 4 1.7 Ghz machine.

However, uninstalling those extra useless apps didn’t help me much. My Linux system was still bloated and running slower than Windows XP.

Right then, I researched over internet and found a solution to my problem.

What is needed:

  • An internet connection (for downloading packages)
  • Atleast 2GiB of HDDSpace
  • Some spare time
  • And obviously you 😉

Get the netinst disk image from the link according to your system architecture. If not sure, then go with the i386 image. Now burn the image to a CDROM and boot your system with it. Continue with the installation and select all options that apply to you and keep an eye out for a dialog box asking about using a network mirror. When this screen comes up, choose No. Choose to install GRUB and let the install finish.

Now, when your computer restarts, choose debian and boot into it. When you get to the login prompt, login as root.

We need to modify the repositories list for your system.

Type:

Code:

nano /etc/apt/sources.list

And put this into the file:

Code:

deb http://ftp.debian.org/debian lenny main contrib non-free

Make sure to comment out the CD-ROM repository entry by putting a number sign (#) in front of it, like this:

Code:

# deb cdrom:…

Later, if you want to add an official debian installation disk (or if you don’t want to use internet for packages), just insert the disk in drive and type:
Code:

apt-cdrom -f -add

Save it (Ctrl+O) and exit (Ctrl+X) and type in:
Code:

aptitude update

This will update the repositories list. Once you it’s done, we’re going to install the base core files needed to run a visual desktop environment, or just the desktop. As an example, we’ll use GNOME, so type in:

Code:

aptitude install xorg gnome-core gdm

This will setup the XOrg server, GNOME core files and the GNOME Display Manager onto your machine. If you want KDE, type:

Code:

aptitude install xorg kde-core kdm

Now, for the Display Manager (login manager), you can use a very limited, simplistic one. Instead of gdm/kdm, use slim.

After all that is done, reboot and let it start up. You’re set! Now you can install a File Manager, Web Browser, Music player, etc of your choice.
For even more lighter system, LXDE can also be tried. And if you want an extreme lightweight system, do not install any desktop environment. Instead just install a windowmanager like fluxbox/openbox etc.