Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

Wednesday, August 25, 2010

Add blog to web site





You see blogs everywhere nowadays. Why have blogs become more popular than conventional web sites? Because they are is much easier to maintain and update. Blog software lets you add, edit and deleted web pages and content through a nice graphical user interface and you don't need to mess with any web programming (including the simple HTML). Now there are several ways to add a blog to a web site and the method you choose would depend on your technical expertise, available resources and the platform on which the web site is hosted. On this page, we shall look at the simplest way to get this done first and then move to more complex options.

Get a blog from a free service and link to it from your existing web site

The easiest and quickest way is to get a free blog and provide a link to it from your existing web site. There are tons of services that will let you make a blog for free - Google's Blogger is probably the most popular of them all. These free blogs can also be customized to reflect your actual web site's layout and colors. Remember the free blog will be hosted on another server though you may be able to get it on your too - this depends on the service you choose.

Add a professional blog to your web site

Obviously, free blogs have limited options. For a professional approach, shell out a few dollars each month and get a fully customized blog. Your blog can actually look exactly like your web site. You again provide a simple link from your existing site to the blog.

Install blog software on your web site through the control panel

Many web hosting companies let you install blog software such as the famous WordPress with a click of a mouse. This is typically done via the Fantastico script library - check with your hosting company. Such blogs can be made to install in a subdirectory on the web server space - don't put them in the document root else the blog will replace your main web site. You can then link to it from your web sites pages.
WordPress is very flexible blog software. You can use a premade design (there are available aplenty on the web), buy one that fits your requirements or even have a template made that looks exactly like your present site.

Install blog on your web site manually

This is a more complex approach and involves download, uploading and then installing blog software on your web server. The options depend on the choice of software and the configuration of the web server.

Which method do I advice?

For business and professional web sites, I suggest going in with the Fantastico option. The only requirement is having PHP and MySQL running on your web server. I recommend Hostgator and Lunarpages web hosting companies who provide excellent hosting plans with the Fantastico scripts library in the control panel.
If you were looking to create a blog web site from scratch, please refer that link for more information.



Bookmark and Share

Friday, August 20, 2010

How to Install PHP on Windows 7








Installing PHP on Windows 7 is quite a simple affair. However, as the more experienced developers would know, you need to have a web server running first. I suggest using the world's most popular web server - get instructions on how to install Apache on Windows 7 operating system. And if you are a budding PHP programmer, you would very soon like to use it with MySQL database. So once you have finished with PHP installation, read the steps to install MySQL on Windows 7.

Assuming you have successfully been able to install Apache on Windows 7 and have seen the "It works" page, download the PHP file from www.php.net. Though I am on a 64 bit Windows 7 system, I downloaded php-5.2.11-Win32.zip because PHP doesn't come in 64 bit flavour.

Create a folder to install PHP

This tutorial will tell you how to install PHP from the zip archive and not from the installer file - [Slide 1]. Somehow, I've found this is a little simpler. So the first thing is to create a folder where you would like to unzip the PHP files. I like to keep things segregated and yet accessible. Giving PHP its own directory under the C: drive is what I generally do. So go ahead and create a folder called PHP in the C drive on your hard disk. Now unzip the contents of the downloaded PHP zip file into this folder - [Slide 2].
In this C:/PHP folder, you'll see a file called php.ini-recommended. Right-click on this file and choose Copy - [Slide 3]. Now paste the file in the same directory - [Slide 4].
Very important: Rename this file to
php.ini. Windows will tell you that changing the extension will make it unusable - Ignore the message and continue - [Slide 5].


Configuration Apache 2.2 web server for PHP installation

Though you have been able to put PHP on your computer, it's still not "installed" in the true sense of the word. We have to help the Apache web server communicate with PHP. This is done by editing the Apache configuration file, httpd.conf. Go to All Programs -> Apache HTTP Server 2.2 -> Configure Apache Server -> Edit the Apache httpd.conf Configuration File. This opens httpd.conf file in Notepad - [Slide 6].
Gear up to make some changes to this file- check the screenshots from the slideshow as you go along.


  • Locate the "LoadModule section" (Tip: use the Find feature or the Ctrl-F key combination). Add the following line - [Slide 7]LoadModule php5_module "c:/PHP/php5apache2_2.dll"

    Note: If you have chosen to install PHP is a different folder and not C:/PHP, you have to change the path in the above line.

  • Find the "AddType" section and put in the line below - [Slide 8].AddType application/x-httpd-php .php

    Note: You can also use other file extensions for PHP like .php3 or .php4 - simply add them at the end of the above line separated by a blank space.

  • Move to the end of the httpd.conf file and add the line below - [Slide 9]PHPIniDir "C:/PHP"

    Note: This tells the Apache web server the location of the PHP configuration file -
    php.ini.

  • If you've read my instructions on installing Apache on Windows7 know that all web site files are to be kept in the htdocs folder located under the Apache install directory. This means when you load http://localhost, Apache checks the htdocs folder - the "It works" file that's displayed the first time you test Apache installation is actually the index.html file in this folder.
    In accordance to my habit of having things organized, I like to keep web site files in their own folder away from Apache program and configuration files... something like
    C:/websites. The good news is that Apache allows you to make such a change pretty easily and to do this, you need to specify this new directory path as the document root.
    First create a folder for your web site files -
    C:/websites is what I use and is a nice choice. Find the DocumentRoot "C:/Apache/htdocs" in the Apache configuration file and change it to DocumentRoot "C:/websites" - [Slide 10].


  • Lastly, change <Directory "C:/Apache/htdocs"> to <Directory "C:/websites"> - [Slide 11].


Testing the PHP installation

Save the httpd.conf file - "File" -> "Save" [Slide 12] and restart your computer. You actually don't need to restart the machine; stopping and starting the Apache service would have probably worked but I needed a cup of tea.
It's now time to test whether PHP was properly installed on Windows 7. Open a Notepad window and type in the line below exactly as it appears - you can copy-paste if you want.
<?php phpinfo(); ?>
Save this file as phpinfo.php in the document root folder which should be C:/websites if you have followed by instructions above.

IMPORTANT: By default, Notepad will save the file as
.txt. So you need to select "All Files" from the "Save as type" drop down and enter the full file name in the "File name" field. Confused? Check the screenshot - [Slide 13].

Open a browser window and load http://localhost/phpinfo.php. A long page with details of the installed PHP version should display - please refer the screenshot in the slideshow - [Slide 14]. If you don't get this and see the PHP code instead, you've probably not saved the file with a .php extension.

This completes the instructions on how to install PHP on Windows 7. I also advice going through the PHP configuration file (php.ini) and making modifications as required.

How to install MySQL on Windows 7



This blog post is on how to install MySQL on Windows 7 is in continuation to the Apache and PHP installations on the same operating system. Before we begin, I like you to determine the system type - whether your computer is 32 bit or 64 bit. This is important as I had a horrendous time trying to troubleshoot PHP-MySQL connection problem - I have detailed this in a blog post - MySQL on a 64 bit Windows 7. You can know the system type from the "Control Panel" -> "System and Security" -> "System".

Download MySQL installer file
Be sure to choose the MySQL installer file that corresponds to your system type. For me, it was the mysql-essential-5.1.40-winx64.msi file from the MySQL.com web site. I chose the essentials file because it is sufficient for my needs. However, there is nothing stopping you from picking the bulky Windows MSI Installer if you want.

Instructions to install MySQL on Windows 7
The screenshots have been presented in a slideshow below - refer these if you have doubts. The process of installing MySQL is not very difficult, so don't be intimidated by the large number of slides; I just wanted to be thorough.



  • Start MySQL installation by double-clicking the .msi file - click "Run" when prompted - [Slide 1].

  • Click "Next" button in the introductory window - [Slide 2].

  • In the following screen, select Custom installation which will allow you to specify the folder to which MySQL will be installed. You can go ahead with a Typical MySQL setup but this will put MySQL deep down in the "Program Files" folder - [Slide 3].

  • Click the "Change" button and enter C:\MySQL in the Folder name field. Hit "OK" when done - [Slides 4 and 5].

  • The installer will change the MySQL installation folder to the one specified by you - [Slide 6].

  • You are now ready to install MySQL on Windows 7 operating system. Click "Install" - [Slide 7].

  • It would take some time for the progress bar to move ahead... be patient - [Slide 8].

  • You may also get messages along the way - simply click on "Next" to proceed - [Slide 9].

  • When the process finishes, you'll get to see the final screen. Congratulations - MySQL has been installed on your computer. You are now prompted to Configure the MySQL server and register the product. In the interest of time, I had unchecked the second box and clicked "Finish". You can do the same if you want - [Slide 10].

  • MySQL instance configuration is important - you cannot use the software until you do so. Click "Next" to proceed - [Slide 11].

  • Select "Detailed Configuration" option - [Slide 12].

  • Choose "Developer Machine" - [Slide 13].

  • I suggest going ahead with "Multifunctional Database" unless you know what you are doing - [Slide 14].

  • In the following screen, don't mess with the default values and click "Next" - [Slide 15].

  • The same goes for the subsequent screen - click "Next" - [Slide 16].

  • For the networking options configuration, put a check mark in front of "Enable Strict Mode" if it's not there - [Slide 17].

  • Yes, it's recommended to install MySQL as a Windows service and have the system include the MySQL bin directory in the Windows PATH variable - [Slide 18].

  • The password for the MySQL server instance has to be typed in twice. Remember to keep a note of it - Don't lose this MySQL password - [Slide 19].

  • The configuration wizard has received all the information it needs and is ready to create a MySQL server instance. Click "Execute" button - [Slide 20].

  • The instance should be configured without problems. If you do get a message from an anti-virus program or the Windows 7 operating system - choose the option to move ahead - [Slides 21 and 22].

Checking the MySQL installation

The easiest way to check MySQL installation and confirm that it's working properly is to use the MySQL Command Line Client. Fire it up from "All Programs" -> "MySQL" -> "MySQL Server 5.1" - [Slide 23].
Now enter the MySQL password - the characters you type will be replaced by the asterisk sign (the password is not shown for security reasons - obviously) - [Slide 24].
The MySQL client displays the mysql> prompt on successful login - [Slide 25]. Type show databases; (the semi-colon at the end is not a typo) and hit the enter key. This simple SQL command instructs MySQL to display the names of the installed databases, which should be three. Hurray - rejoice because you have been able to correctly install MySQL on Windows 7! [ Slide 26]

Configuring PHP to work with the MySQL installation

The PHP configuration file is php.ini located right in the install directory which should be C:/PHP if you have followed my instructions on how to install PHP on Windows 7 computer. We now have to modify this file so that all the three - Apache, PHP and MySQL - work together.

  • By default, PHP doesn't display error messages. This may be a good idea on a web server (security reasons) but for a developer machine (such as your local computer), you would like to see errors. The PHP error messages can point to the line which is causing your scripts to fail.
    [Slide 27] - Find the line
    error_reporting = E_ALL and change it to error_reporting = E_ALL & ~E_NOTICE
    [Slide 28] - Also change
    display_errors = Off to display_errors = On.

  • PHP also needs to be told the directory in which the extensions reside. Unearth the extension_dir = "./" line and change it to extension_dir = C:\PHP\ext. (I've assumed you've installed PHP in C:/PHP. If not, you have to specify the correct path.) - [Slide 29]

  • We need PHP to work with MySQL and, hence, have to load the required extensions. Locate the 'Extensions' section and uncomment (remove the semicolon in front of) the following lines - [Slide 30].extension=php_mysql.dll
    extension=php_mysqli.dll


  • [Slide 31] - Locate the register_globals = Off line and change it to register_globals = On. Experienced developers would tell you not to go ahead with this modification. I do this because a lot of my scripts won't work otherwise - I leave the decision to you.
Save the php.ini file and restart your computer - this will give you time to stretch your legs. By the way, as I had mentioned in the beginning, you have to a web server for PHP to work - read install Apache on Windows 7 for instructions.
Finally, if you have already been using MySQL on another computer you can quickly transfer the databases and tables using mysqldump and the mysql programs.

How to Install Apache on Windows 7


This blog provides detailed step by step instructions on how to install Apache on Windows 7 operating system. Chances are that you would follow the Apache installation with PHP and MySQL database.
Though not required for installing Apache, I suggest you check the system type - whether the Windows 7 your computer is running is 32 bit or 64 bit. This information is available from "Control Panel" -> "System and Security" -> "System" -> "System type". We'll need it when we come to installing MySQL.

Download the Apache Windows installer file
Point your browser to the Apache download page. Click on Win32 Binary without crypto (no mod_ssl) (MSI Installer) file; for instance, I downloaded apache_2.2.14-win32-x86-no_ssl.msi. Double-click on this file to start Apache installation. If you are shown a security warning, ignore it and click "Run" to continue - [Slide 1 in the slideshow below].



  • Click on "Next" in the introductory screen - [Slide 2].

  • Select the "I accept the terms in the license agreement" radio button and hit "Next" - [Slide 3].

  • Enter localhost for both "Network Domain" and "Server Name". In the "Administrator's Email Address" field I generally type in webmaster@localhost. Move to the next screen - [Slide 4].

  • Proceed with Typical installation type, unless you want to be adventurous! - [Slide 5]

  • As you can see from the screenshot, by default, Apache is installed in a folder deep under the "Program Files folder. I don't like this and would recommend that you change the installation directory too. I like to keep things slightly organized and prefer Apache to reside in its own folder on the C: drive. I entered C:\Apache as the destination folder and I suggest you do the same - [Slides 6 and 7].

  • To start installing Apache 2.2 on Windows 7, click on the "Install" button and sit back - [Slides 8 and 9].

  • By the way, if the installation process is interrupted by the anti-virus program on your computer, just provide permissions for it to continue - [Slide 10].

  • In a few minutes, the Apache web server would be installed on your Windows 7 computer - [Slide 11].

  • To test the installation, open a web browser window, enter http://localhost/ in the address bar and hit the "Enter" key - [Slide 12].

  • If you get a page with the words "It works!", celebrate, because you now have the Apache web server running on your Windows 7 computer. Didn't get this message? You may need to start Apache. Go to "All Programs" -> "Apache HTTP Server 2.2" -> "Control Apache Server" and select either "Start" or "Restart". The Apache server can also be started and stopped from "Services" under the Control Panel - [Slide 13 and 14].
For the newly initiated, the HTML file that is displayed when you load http://localhost/ is index.html located inside the htdocs folder in the Apache install directory. Now that Apache has been installed on your Windows 7 computer and is successfully running.

Recommend this

Related Posts Plugin for WordPress, Blogger...