PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: drupal 7 beta3

If this issue getting you have to increase  max_allowed_packet in MySQL ini file

xampp –> mysql –> my.ini

max_allowed_packet = 1M –> max_allowed_packet = 16M

 

Create herder & footer pages and include in Drupal 7

  1. You will create two files header.php and footer.php.
  2. Create a folder “include” in your theme directory.
  3. Suppose that your theme directory is “aviweb” sites/all/themes/aviweb. Put header.php and footer.php file in “sites/all/themes/aviweb/include” theme folder.
  4. By using html and php you can write code in header.php and footer.php.
  5. Now you can include both files in page.tpl.php in header area and footer area like PHP.

<?php include_once($theme_path.’/include/header.php’); ?>

<?php include_once($theme_path.’/include/footer.php’); ?>

Hot to update Drupal 7 website

  1. Make a backup of your Drupal instance (database).
  2. Set your site on maintenance mode.(Click here)
  3. Delete all the files & folders inside your original Drupal instance except for /sites and its sub-folders.
  4. Warning: If your Drupal installation is built from a distribution your site will break if you delete the /profiles folder. Don’t delete the profile folder that corresponds to the distribution you installed, for example /profiles/kickstart if you installed Drupal Commerce Kickstart.
  5. Copy all the folders and files except /sites from inside the extracted Drupal package [tar ball or zip package] into your original Drupal instance location.
  6. Some updates do not include changes to setting.php and some do. If the update release includes changes to settings.php you will need to replace your old settings.php in …/sites/default/ with the new one, and then edit the site-specific entries (eg database name, user, and password) in the setting file.
  7. If you have modified files such as .htaccess or robots.txt re-apply those changes to the new files.
  8. If you have a favicon.ico file that was deleted replace it too
  9. Login to your site as administrator
  10. Run “update.php” by navigating to http://yourdrupalsitename/update.php and follow the process to update your Drupal instance
  11. Disable maintenance mode.

Create font page template in Drupal 7

To create front page template please find below steps

  • Create “page–front.tpl.php” template in current theme and copy the home page PHP code into that.
  • Next create one “Home” page and Promote as front page like below screenshot.

  • Once we done above steps it will work as front page with “page–front.tpl.php” code.

Sorry, it seems there are no available payment methods which support subscriptions. Please contact us if you require assistance or wish to make alternate arrangements.

When getting this type of issue please check site SSL is enable or not.

Stripe is enabled, but the force SSL option is disabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate – Stripe will only work in test mode.

Node vs. entity in drupal

Please find below given clear explanation…..

  • To me, the concept of “node” is fairly clear: It is an “instantiation” of a content-type. When you add content, you choose the type, e.g. “Article”, and the content that you add (e.g. the article text, title, images, etc.) is stored as one unit in the database, and is also often assigned its own URL path. A node is then retrieved, upon user request (i.e. the appropriate HTTP GET), by the node module and passed on to the template which places in on its appropriate place in the layout and generates and returns the webpage (the actual final markup that is served to the browser) by adding in other components of the page (e.g. menus, blocks, etc.). What I find a bit fuzzy however is the concept of entity. A user is an entity, so is a node? How about a role, or a block? How about a comment or a menu? Are those entities too?I can’t yet quite see its place in the overall scheme.
  • To me, “entity” is just a fancy synonym for “thingie”, which is about as vague (or general/abstract) as you could get. Indeed, if knew what is NOT an entity, it might become clearer.

Menu code for drupal 7

/* Menu code for drupal 7 */
<?php
$main_menu_tree = menu_tree(‘main-menu’);
foreach ($main_menu_tree as $key => &$main_menu_item) {
if (is_numeric($key)) {
$main_menu_item[‘#below’][‘#theme_wrappers’][0] = ‘some_other_theme_wrapper’;
}
}
print drupal_render($main_menu_tree);
?>

Main difference between drupal and wordpress

  1. Drupal wins this round. WordPress’ many plugins can have vulnerabilities and be easily hacked, particularly if the website owner doesn’t update to the latest version or the plugin gets old. Or simply, hackers target WordPress because it is so popular. However, there is a paradox solution: install third-party plugins that increase your security.
  2. One big difference between the two is how they handle mobile sites. Many of Drupal’s mobile themes run better off a subdomain, which creates two separate URLs to index in search engines i.e. http://www.yourdomain.com and http://www.m.yourdomain.com. WordPress doesn’t have this issue as most of its themes are mobile responsive.
  3. Search Engine Optimization isn’t platform specific but there are a few tricks that make one better than the other. Both have SEO built into them. It has been said that Drupal was built specifically to be search engine friendly but WordPress has a multitude of plugins that can enhance this.  Drupal’s pages tend to load faster due to its default caching features, and search engines put a preference on faster websites.Drupal is also able to handle larger amounts of content. A large volume of useful content is important for SEO.

Turning on wordpress and drupal debugging

WordPress

public_html/wp-config.php
Change wordpress debugging mode to true like below in wp-config.php
define(‘WP_DEBUG’, true);
or add code below
define( ‘SCRIPT_DEBUG’, true );

Drupal

sites/default/settings.php

Add below code in settings.php file.
$config[‘system.logging’][‘error_level’] = ‘verbose’;