Sunday, 31 March 2013

Set a Fixed Amount of Memory (SQL Server Management Studio)

Some times the SQL database uses large amount of RAM on the server which causes issues on the server, you can set a fixed amount of memory using the below steps. 

  1. In Object Explorer, right-click a server and select Properties.

  2. Click the Memory node.

  3. Under Server Memory Options, enter the amount that you want for Minimum server memory and Maximum server memory.

    Use the default settings to allow SQL Server to change its memory requirements dynamically based on available system resources. The default setting for min server memory is 0, and the default setting for max server memory is 2147483647 megabytes (MB).

Could not load file or assembly \'CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0

If you face the below crystal report related error, kindly search the required crystal report from following link and install it.

http://scn.sap.com/docs/DOC-7824

Parser Error Message: Could not load file or assembly \'CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304\' or one of its dependencies. The system cannot find the file specified.

Thursday, 28 March 2013

Custom php.ini per domain in Plesk Windows server


There will always be the scenarios where we need to set some special php settings for a particular domain or for a particular directory. This can be easily done in a Linux server, but with Windows it is always issues. But we can done this windows servers also and tell you what i have verified this by myself.

Prerequisites:-

*Custom php,ini file only works with php handler as “cgi” and not with “fastcgi” nor with ISAPI extension. So you need to verify this before you proceed further.

Follow the below steps to set the correct php mode.

1. Log in to your Hosting Control Panel
2. Select your domain name
3. Under “Web Site” tab, click on “Web Hosting Settings”
4. Under “PHP Support”, select your desired “PHP Mode” settings(cgi mode)
5. Hit the “Ok” button to activate.

Assumptions:-

    The default location of php.ini for PHP5 is the PleskPHP5 base directory %plesk_dir%AdditionalPleskPHP5 (Eg: c:Program FilesParallelsPleskAdditionalPleskPHP5). If you place an PHP info page, you can easily find out from where the current php settings is loaded.
    The document root of the domain “maindomain.com” is “d:Inetpubvhostsmaindomain.comhttpdocs”. Please note that this may be different in your hosting environment.
    The server I am working on is a x86 based server.
    Plesk version is 10.3.1, but it should work with others also.

Turn off the register_globals

I will explain the procedures with an example to turn off the register globals . There are two ways to configure php values for a particular domain:-

1. By placing an customized php.ini page on the corresponding directory or in domain.
2. By creating a Windows registry value for the particular php settings.
Placing an customized php.ini page on the corresponding directory
You need to place the php.ini file in “maindomain.com/httpdocs” directory or if you want to apply the only to a addon domain or a directory, then use the directory “maindomain.com/httpdocs/addondomain.com”.

Follow the below steps:-

1. Copy the PHP version 5 (php.ini-recommended or php.ini) ini file from the PHP location %plesk_dir%\AdditionalPleskPHP5 to the location “maindomain.com/httpdocs”
2. Rename the copied file to the exact name as ‘php-cgi-fcgi.ini‘. This is the most important step and won’t work otherwise.
3. You can make the changes needed to the above ini file, say set the “register_globals = Off”.
3. Create a php info page the corresponding directory and verify it is loading the correct “php.ini” (check the loaded configuration file section). Also verify whether the value you have changed is now updated under the ‘PHP info’ page.

This should do the work. If this method doesn’t work for you, here is the second method.

Creating a Windows registry value

Even though this is a simple procedure, i do not recommend anyone to edit the Windows Registry because if you screw up anything with Registry, you will also screwed up :)

When running PHP on Windows, the configuration values can be modified on a per-directory basis using the Windows registry. The configuration values are stored in the registry key HKLMSOFTWAREPHP5Per Directory Values, in the sub-keys corresponding to the path names. For example, configuration values for the directory c:inetpubwwwroot would be stored in the key HKLMSOFTWAREPHP5Per Directory Valuescinetpubwwwroot. The settings for the directory would be active for any script running from this directory or any subdirectory of it. The values under the key should have the name of the PHP configuration directive and the string value.

Simply, you can only add individual php configuration value inside of php.ini through the registry, which means that you have to set up keys to the file path ( where the client’s hosting folder located ) and then add a string value, string name will be the php.ini configuration name and value will be how you want it to be. So for setting register_globals to off for the maindomain.com, you have to setup keys to the path “HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > PHP > Per Directory Values > C > Inetpub > vhosts > maindomain.com > httpdocs” and then add a string value, string name will be “register_globals” and value will be 0 to put register_globals= off.
Note:

For 32 bit Windows registry path is ,  HKLMSOFTWAREPHP5Per Directory Values
For x64 based Windows registry path is,  HKEY_LOCAL_MACHINESOFTWAREWow6432NodePHP5Per Directory Values

Reference:-

http://forum.parallels.com

http://www.php.net

How to upgrade Zen Cart 1.3.9 to Zen Cart 1.5



To upgrade your Zen Cart 1.3.9 to Zen Cart 1.5, follow the following steps. (For this tutorial, I assume you are using cpanel web hosting)

1. Backup your existing Zen Cart 1.3.9 website by logging on to your Cpanel > File Manager and select all files and then click compress and save the zip file. If your zencart is in a folder e.g /zen then select this folder and click compress to zip the files.

2. Now backup your existing mysql database, go to phpmyadmin in your cpanel hosting and then click the database name on the left and then click export to export the database dump.

3. Login to your admin and make a list of all the modules that are installed like shipping modules (ups/usps), image handler etc in a notepad file.

4. Download the latest zen-cart 1.5 from zen-cart.com and then using ftp upload the zip file to your public_html folder. Extract the zip file to your desktop as well for later reference.

5. Using File Manager again, select the zip file and then click extract to extract the files in a folder e.g /newzen

6. When you will extract the zip file, it will create another folder “zen-cart-v150-full-release-12302011″  inside newzen so open that folder and then select all the files and move them out of this folder to /newzen folder.

7. Now create a new database by going to phpmyadmin and then click import to import the database dump that you exported before, mysql database of your Zen Cart 1.3.9 website (Step 2)

8. Extract your Zen Cart 1.3.9 backup files and then edit Zencart 1.3.9 backup folder/includes/configure.php and update the path, database name, database user and password and then using ftp upload it to public_html/newzen/includes folder. Similarly, edit the admin configure file by going to Zencart 1.3.9 backup folder/youradminfolder/includes/configure.php and upload it to your public_html/newzen/admin/includes folder

9. Copy the images folder from your 1.3.9 backup folder and upload it to /public_html/newzen

10. Now go to http://yourdomainname.com/newzen/zc_install and then choose “Database Upgrade”.  If Database Upgrade option is not there, then you will have to look at the configure files as the installer was not able to connect to the database.

11. Delete the zc_install folder and then rename the admin folder. When you rename the admin folder also update the configure file (youradminfolder/includes/configure.php)

12. You may have made many changes to your languages folder so use the tool (WinMerge) to compare the zen cart 1.3.9 backup folder with the zen cart 1.5 folder and note the files that are different. You may have installed custom template so there will be extra files as well. So copy the custom template folders/files to the new upgraded store.

13. Re-Install all the modules (Shipping/Payment) and other modules that you had on your old zencart store. (All mods may not be compatible with the new version)

14  Test everything.

15. Now move your Zen Cart 1.3.9 files from public_html folder to /oldsite and move the contents of /newzen folder to the root and then update the configure files. And if you had the zencart in a folder then rename the newzen to store or catalog.

You are finally done with the upgrade of your zen cart store.

How to bulk import products into Zencart 1.5

If you want to import products in bulk into Zen cart then follow the steps below

1. Download EasyPopulate 4.0 (EP4) module for Zencart by going to https://github.com/chaddro/EasyPopulate-4.0

2. Change the name of the admin directory to match your Zen Cart Installation.

3. Using Filezilla (ftp), upload all the files in admin directory to your site maintaining the directory structure.

4. Upload the additional file in zencart 1.5 extra files folder.

5. Create a folder ‘temp’ in the root of your zencart store. You may edit the uploads folder by going to Configuration -> Easy Populate 4

6. Add 2-3 categories and products manually.

7. Then go to Tools >Easy Populate 4

8. Click on Complete Products (with Metatags) to export the csv. This will save the csv to the uploads directory (temp folder)


9. Download this csv file and open it with Open Office Calc or Microsoft Excel.

10. Populate this csv file with your products data.
        v_products_model has to be unique, any record with blank v_products_model will be skipped
        Upload all your images in your zencart images folder and add the name of the image with extension to v_products_image column in the csv.

11. When your csv is ready, go to Tools > Easy Populate 4 and Upload EP File (Choose File and then click Import File)

12. When the file is imported, click “Import” against that file and your products will be imported into your zencart store.

13. After the import is complete, you can have a look at Import Results for the no of records inserted and updated.

How to move wordpress site to a new Website


In this tutorial I will explain how you can transfer your wordpress site from one domain to another. I’ll assume you are using cpanel web hosting.

1. Login to your cpanel hosting and go to File Manager and select all the wordpress files and then click compress to create a backup (backup.zip) of your wordpress site.

2. Download the backup.zip file by going to yourdomain.com/backup.zip

3. Then go to phpmyadmin and on your left click on the database name and then click Export. Select Custom Export Method and choose Output “Save output to a file “ and then choose Compression “zipped or gzipped” and click Go. This will download the compressed database/mysql dump file.

4. Extract the database file and then open it with an editor (e.g notepad++) and press Cntrl+H to replace all the occurrences of domain with the new domain name.

5. Now login to your new hosting’s cpanel (If the new domain is hosted on the new hosting)

6. Under Databases click on MySQL® Databases and create a new database for the new domain, Add new database user and then add that user to that database.

7. Then go to phpmyadmin and on your left click on the new database that you created and click Import and then click Choose File to browse for the mysql file and then click Go. Database will be imported.

8. Using ftp (Filezilla) upload the wordpress files (backup.zip) and then using File Manager in Cpanel, extract the zip file. You are in public_html folder, so when you will extract the zip file it will create a new folder backup in public_html so open this folder and move all the contents of this folder to public_html folder. If you have added the domain as an addon domain then move the wordpress files to its respective folder.

9. Update the wp-config file with the new database details (database name, username and password)
 

You are done with moving your wordpress site to a new website.

An error has occurred. Furthermore, Horde encountered an error attempting to log this error. Please check your Horde logging configuration in horde/config/conf.php

When you get the error "An error has occurred. Furthermore, Horde encountered an error attempting to log this error. Please check your Horde logging configuration in horde/config/conf.php."


Most probably this error occurs due to soft-failed Horde upgrade. AFAIK starting from Horde 3.2 they reimplemented logging solution, so if not all files were replaced you might suffer from compatibility problems.

To solve the issue, please follow the below steps :

Open the conf.php file which usually can be found at :

'/etc/psa-webmail/horde/horde/conf.php' (for linux)
or 'C:\inetpub\vhosts\webmail\horde\config\config.php ' (for windows), pathes may vary on different Plesk and OS versions.

Once you have opened the file, search for : $conf['log']['enabled']
It will be enabled by default. Just change the value from 'true'  to 'false' so that it looks like :

$conf['log']['enabled'] = 'false';

This will solve you issue.