Thursday, December 26, 2013

PHP, Apache and MySQL configuring manually in Window 7 64bit

Apache 2.4 Install

Download Apache 2.4 from http://www.apachelounge.com/download/ (apache_2.4.2-x64-openssl-1.0.1c ).


The following steps will walk you through the installation:
  1. Select Next
  2. Select "I accept the terms in the license agreement"
  3. Select Next
  4. Fill in your server information if it is known. A typical setup will use the "for All Users, on Port 80, as a Service" option. If this is being setup as a test machine, you may use localhost as the Network Domain and the Server Name. Select Next.
  5. Select the Typical Setup
  6. Choose a Destination Folder for the Installer to place the program files into. Note: the default Apache Installer location is C:\Program Files\Apache Software Foundation\Apache2.4. Because of the spaces in the directory name, using this folder may cause cgi and php scripts to not find the paths correctly.
  7. Select Finish
  8. If a Firewall is enabled, make sure that port 80 and port 8080 are unblocked and open.
  9. To test if the Apache server is running, open up http:\\localhost in a browser. A plain black and white page should come up that reads "It Works!"

Configuring Apache:

  1.  Using a text editor such as Notepad, open the httpd.conf file. This file is found in the /conf sub-directory under the directory that was set up during installation.
  2.  In the Apache configuration files,(forward slashes) / should be used in path names. 
  3. Change the DocumentRoot to point to the location of the root document folder. It would point to "C:/Program Files/Apache Software Foundation/Apache2.4/htdocs". 
    Note: Wrapping the path name in quotes will escape out any spaces that are used.
  4. Change the Directory path to match the one used in the previous step. This is found on line 177 of the default httpd.conf file.
  5. Add to index.php to the DirectoryIndex(replace the index.html)
  6. Append the following lines to the end of the httpd.conf file:
           LoadModule php5_module "c:/php/php5apache2_4.dll"
           AddType application/x-httpd-php .php
           PHPIniDir "C:/php"
  7. Save and Close.

Download PHP:

     Download php from http://windows.php.net/download/

Installing PHP:

  1. Unzip the PHP files to C:\php
  2. Copy c:\php\php-ini-recommended.ini and rename itc:\php\php.ini
  3. Uncomment the Windows include_path.
    Note: In the PHP.ini file, semicolons are used to denote that something is commented out. To uncomment a line, simply remove the semicolon.
  4. Update the doc_root to match the one that was set up in the httpd.conf file. 
    Note: The PHP INI files uses the Windows style backslash \ for path names.
  5. Update the extension_dir on line 520 to "C:\php\ext"
  6. Uncomment php_gd2.dll extension.
  7. Uncomment mysql.dll extension.
  8. Update the sessions.save_path to the Windows temporary files directory (i.e. C:\Temp).
  9. The PHP directory needs to be added to the Path Environment Variables
    1. Open the Control Panel
    2. Open System > Advanced > Environment Variables
    3. Append ;C:\php to the end of the Path System Variables list and Click OK.
  10. Restart Apache
  11. To test PHP on Apache, go to the root directory (i.e. C:\Program Files\Apache Software Foundation\Apache2.2#92;htdocs) and create a new php file in it. In this file, use PHP's phpinfo() function to see the server's configuration information. For example: 
    <html>
    <body>
    <?php phpinfo() ?>
    </body>
    </html>


 


Wednesday, December 11, 2013

"Priority 3" DDA Compliance Checklist by W3C

1.5 Until user agents render text equivalents for client-side image map links, provide redundant text links for each active region of a client-side image map. [Priority 3]

4.2 Specify the expansion of each abbreviation or acronym in a document where it first occurs. [Priority 3]

4.3 Identify the primary natural language of a document. [Priority 3]

5.5 Provide summaries for tables. [Priority 3]

5.6 Provide abbreviations for header labels. [Priority 3]

9.4 Create a logical tab order through links, form controls, and objects. [Priority 3]

9.5 Provide keyboard shortcuts to important links (including those in client-side image maps), form controls, and groups of form controls. [Priority 3]

10.3 Until user agents (including assistive technologies) render side-by-side text correctly, provide a linear text alternative (on the current page or some other) for all tables that lay out text in parallel, word-wrapped columns. [Priority 3]

10.4 Until user agents handle empty controls correctly, include default, place-holding characters in edit boxes and text areas. [Priority 3]

10.5 Until user agents (including assistive technologies) render adjacent links distinctly, include non-link, printable characters (surrounded by spaces) between adjacent links. [Priority 3]

11.3 Provide information so that users may receive documents according to their preferences (e.g., language, content type, etc.) [Priority 3]

13.5 Provide navigation bars to highlight and give access to the navigation mechanism. [Priority 3]

13.6 Group related links, identify the group (for user agents), and, until user agents do so, provide a way to bypass the group. [Priority 3]

13.7 If search functions are provided, enable different types of searches for different skill levels and preferences. [Priority 3]

13.8 Place distinguishing information at the beginning of headings, paragraphs, lists, etc. [Priority 3]

13.9 Provide information about document collections (i.e., documents comprising multiple pages.). [Priority 3]

13.10 Provide a means to skip over multi-line ASCII art. [Priority 3]

14.2 Supplement text with graphic or auditory presentations where they will facilitate comprehension of the page. [Priority 3]

14.3 Create a style of presentation that is consistent across pages. [Priority 3]

Monday, December 9, 2013

"Priority 2" DDA Compliance Checklist by W3C

3.1 When an appropriate markup language exists, use markup rather than images to convey information. [Priority 2]

3.2 Create documents that validate to published formal grammars. [Priority 2]

3.3 Use style sheets to control layout and presentation. [Priority 2]
3.4 Use relative rather than absolute units in markup language attribute values and style sheet property values. [Priority 2]
3.5 Use header elements to convey document structure and use them according to specification. [Priority 2] 
3.6 Mark up lists and list items properly. [Priority 2]

3.7 Mark up quotations. Do not use quotation markup for formatting effects such as indentation. [Priority 2]
5.3 Do not use tables for layout unless the table makes sense when linearized. Otherwise, if the table does not make sense, provide an alternative equivalent (which may be a linearized version). [Priority 2] 
 

5.4 If a table is used for layout, do not use any structural markup for the purpose of visual formatting. [Priority 2]
6.4 For scripts and applets, ensure that event handlers are input device-independent. [Priority 2]

6.5 Ensure that dynamic content is accessible or provide an alternative presentation or page. [Priority 2]

7.2 Until user agents allow users to freeze moving content, avoid movement in pages. [Priority 2]

7.3 Until user agents provide the ability to stop the refresh, do not create periodically auto-refreshing pages. [Priority 2]

7.4 Until user agents provide the ability to stop auto-redirect, do not use markup to redirect pages automatically. Instead, configure the server to perform redirects. [Priority 2]

7.5 Make programmatic elements such as scripts and applets directly accessible or compatible with assistive technologies [Priority 1 if functionality is important and not presented elsewhere, otherwise Priority 2.]

9.2 Ensure that any element that has its own interface can be operated in a device-independent manner. [Priority 2]

9.3 For scripts, specify logical event handlers rather than device-dependent event handlers. [Priority 2]

10.1 Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user. [Priority 2]

10.2 Until user agents support explicit associations between labels and form controls, for all form controls with implicitly associated labels, ensure that the label is properly positioned. [Priority 2]

11.1 Use W3C technologies when they are available and appropriate for a task and use the latest versions when supported. [Priority 2]

11.2 Avoid deprecated features of W3C technologies. [Priority 2]

12.2 Describe the purpose of frames and how frames relate to each other if it is not obvious by frame titles alone. [Priority 2]

12.3 Divide large blocks of information into more manageable groups where natural and appropriate. [Priority 2]

12.4 Associate labels explicitly with their controls. [Priority 2]

13.1 Clearly identify the target of each link. [Priority 2]

13.2 Provide metadata to add semantic information to pages and sites. [Priority 2]

13.3 Provide information about the general layout of a site (e.g., a site map or table of contents). [Priority 2]

13.4 Use navigation mechanisms in a consistent manner. [Priority 2]

Friday, December 6, 2013

Drupal Questions

What is a Module in drupal ?
A module is software (code) that extends Drupal features and/or functionality. Drupal Supports – Core modules – included with the main download of Drupal, and you can turn on their functionality without installing additional software. Contributed modules are downloaded from the Modules download section of drupal.org, and installed within your Drupal installation. You can also create your own module – CustomModules” using PHP programming, and Drupal’s module API.

What modules do you always recommend and why?

  • Views - This module is essential in every website I build. It makes displaying lists of content very easy. If you want an image slideshow, a list of blog posts, a list of products, etc., views is the best place to start.
  • Panels - Panels gives you the ability to create custom pages easily. These custom pages can have multiple regions of content. For example, you may want to create a home page that has a Slideshow on the top, and a two column layout below.
  • Ctools - On its own, Ctools does not seem to do a lot. However, it is actually a very powerful framework if you begin developing your own modules. I have used Ctools in the past for developing multi-step forms, modal dialog boxes, and even multi-step forms inside of modal dialog boxes.
  • Token - Tokens are little snippets of text that can be used as replacement patterns. For example, if your website sends out emails and you want to add in the users name, or you want fill in a link path with a node id to provide a helpful link to content, tokens will save the day.
  • Pathauto - The Pathauto module is a necessity for any website that frequently adds new content. It is also especially important if you have a website that allows users to create content using content types. Pathauto simplifies creating clean and search engine friendly URLS for the various content you add to your site.
  • Webform - If you want to provide easy to fill out forms for the visitors of your site, the Webform module will help you out.
  • Rules - Drupal rules will allow you to set up condition actions.
  • Date - This is useful for allowing the easy selections of dates in content types (with a nice date popup). It also integrates nicely with the views module.
  • Quicktabs - Makes it easy to add tabbed content without having to write your own Javascript/Jquery. What more do I have to say?
  • Libraries - Makes organizing your various libraries of functionality easy (see Jquery UI above for an example).
  • Google Analytics - I don’t build a Drupal website without adding Google Analytics. This module makes it very simple. What gets measured, gets improved after all.
What are hooks in Drupal ?
hooks are drupal api code which allows module to interact with the Drupal core.
Drupal’s module system is based on the concept of “hooks”. A hook is a PHP function that is named foo_bar(), where “foo” is the name of the module (whose file name is thus foo.module) and “bar” is the name of the hook. Each hook has a defined set of parameters and call back functions to trigger functionality on specific event.  For example if you use form with submit button, on submit event you can have specific functionality.

Installing the cUrl in PHP in a windows machine running wamp server

  • Requirements

    In order to use PHP's cURL functions you need to install the » libcurl package. PHP requires that you use libcurl 7.0.2-beta or higher. In PHP 4.2.3, you will need libcurl version 7.9.0 or higher. From PHP 4.3.0, you will need a libcurl version that's 7.9.8 or higher. PHP 5.0.0 requires a libcurl version 7.10.5 or greater. 

    Follow to steps below to enable the php_curl extension.  

Steps to Install php_curl extension:  

  • Left click wamp tray icon and Go to PHP and PHP extension and click the php_curl item to enable it.
  • The server will restart on its own or restart manually if not.
  • Remove ';' from extension = php_curl.dll in php.ini file
  • Go to the ext directory of your php installation and copy php_curl.dll, ssleay32.dll and libeay32.dll to the Windows/system32 folder
  •  That's it. Now restart you server and you have your curl php extension enabled in your php.

Thursday, December 5, 2013

Upgrading the Drupal 7 major and minor versions

Here in this post I point out the steps to Upgrade Drupal major and minor version.

Steps to Upgrade Drupal minor version.
  • Backing up the site,
  • Putting it into maintenance mode.
  • Downloading the new version of the module.
  • Uncompressing it.
  • Running "yoursite.com/update.php".
  • Testing the site.
  • Taking the site out of maintenance mode.
Steps to Upgrade Drupal minor version.
  • Backup your existing site and database.
  • Log in as user ID 1.
  • Put your site in maintenance mode.
  • Change all themes to Garland.
  • Disable non-core modules.
  • Remove default settings file.
  • Remove all old core files and directories.
  • Remove uninstalled modules.
  • Download Drupal 7.
  • Re-apply modifications to core files.
  • Make your settings.php file writeable.
  • Run the update script.
  • Backup your database.
  • Upgrade fields.
  • Update contrib modules and themes.
  • Check the Status Report.
  • Make sure settings.php is secure.
  • Check Drupal Core Modules.
  • Remove your site from Maintenance Mode.

"Priority 1" DDA Compliance Checklist by W3C

1.1 Provide a text equivalent for every non-text element (e.g., via "alt", "longdesc", or in element content). This includes: images, graphical representations of text (including symbols), image map regions, animations (e.g., animated GIFs), applets and programmatic objects, ascii art, frames, scripts, images used as list bullets, spacers, graphical buttons, sounds (played with or without user interaction), stand-alone audio files, audio tracks of video, and video. [Priority 1]
 
1.2 Provide redundant text links for each active region of a server-side image map. [Priority 1]
 
1.3 Until user agents can automatically read aloud the text equivalent of a visual track, provide an auditory description of the important information of the visual track of a multimedia presentation. [Priority 1]
 
1.4 For any time-based multimedia presentation (e.g., a movie or animation), synchronize equivalent alternatives (e.g., captions or auditory descriptions of the visual track) with the presentation. [Priority 1]
 
2.1 Ensure that all information conveyed with color is also available without color, for example from context or markup. [Priority 1]

4.1 Clearly identify changes in the natural language of a document's text and any text equivalents (e.g., captions). [Priority 1]

 
5.1 For data tables, identify row and column headers. [Priority 1] 
 
5.2 For data tables that have two or more logical levels of row or column headers, use markup to associate data cells and header cells. [Priority 1] 
 
6.1 Organize documents so they may be read without style sheets. For example, when an HTML document is rendered without associated style sheets, it must still be possible to read the document. [Priority 1] 
 
6.2 Ensure that equivalents for dynamic content are updated when the dynamic content changes. [Priority 1] 
 
6.3 Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page. [Priority 1] 
 
7.1 Until user agents allow users to control flickering, avoid causing the screen to flicker. [Priority 1]
 
8.1 Make programmatic elements such as scripts and applets directly accessible or compatible with assistive technologies [Priority 1 if functionality is important and not presented elsewhere, otherwise Priority 2.] 
9.1 Provide client-side image maps instead of server-side image maps except where the regions cannot be defined with an available geometric shape. [Priority 1]
11.4 If, after best efforts, you cannot create an accessible page, provide a link to an alternative page that uses W3C technologies, is accessible, has equivalent information (or functionality), and is updated as often as the inaccessible (original) page. [Priority 1]
12.1 Title each frame to facilitate frame identification and navigation. [Priority 1]
  
14.1 Use the clearest and simplest language appropriate for a site's content. [Priority 1]