Friday, August 10, 2007

Drupal set up - see it running!

I have not worked with PHP before nor Drupal.

But there was project running in my company in Drupal. I have been hearing about this project a lot and it was so interesting for me to listen to their work like running Apache, PHP and MySQL.

Excitement is the platform. For last few years, I have been completely in to Microsoft platform, this open source stack really excited me. Before I was working in MS platform, I had oppurtunity to work in Java, PostGreSQL and other non-MS stuff and so thought would try once again.

I have tried to briefly describe about how to set up drupal quickly.

Setting up Drupal: (All these links may go invalid later, but visit each of their site, it is easy to find the download)
1. Download drupal http://ftp.drupal.org/files/projects/drupal-5.2.tar.gz
2. Download PHP, say 5: http://www.php.net/get/php-5.2.3-Win32.zip/from/a/mirror
3. Download Apache http://mirror.olnevhost.net/pub/apache/httpd/binaries/win32/apache_2.2.4-win32-x86-no_ssl.msi
4. Download MySQL. http://dev.mysql.com/downloads/ Download "mysql-essential"

Step1: Install Apache.
Pretty straight forward, the wizard will guide you. You can register Apache as windows service. Command to register Apache as service
"httpd.exe -k install -n "

Edit httpd.conf: Configure the default document.


DirectoryIndex index.html
DirectoryIndex index.php


Step2: Install MySQL.
Pretty straight forward as well. Follow the Wizard.

Step3: Install PHP
Extract PHP zip to a convenient location, say c:\php. Add c:\php to PATH variable. Hook php to Apache. Edit httpd.conf and add these lines
#PHP Configuration#Begin
# For PHP 5 do something like this:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini

PHPIniDir "C:/php"
#End PHP Configuration


Step4: Configure PHP to use MySQL
If you are using PHP 5+, MySQL is not enabled by default. To enable SQL, edit php.ini. First modify the extension directory and set to
extension_dir = "c:\php\ext"
Enable the Mysqli extension
extension=php_mysqli.dll

Step5: Creating database for drupal and make note of the database, username and password

Step6: Extract the drupal download to somewhere under Apache installation. Edit the httpd.conf of apache to point to the drupal directory. Eg.
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/drupal"

Make sure MySQL is running and Apache is running as well.

Now it is time to install the drupal. Type http://localhost:8080/ (*Assuming apache running at 8080). This should show you the Database configuration page. Enter the database, username and password, rest is taken care. It creates default tables and data and finally shows up the drupal administration page. Wow!!! I may not be totally correct. But this is what I did and it worked :). There is guy who has gone deep in to drupal, I shall discuss with him and put more info here.

3 comments:

Venkateswaran R said...

"There is a guy..."...Who is that? Is it Ramaiah Ariya the AGM Technology of Photon?

varunkrish said...

Nice to see somethin abt open source by a hardcore ms techie :)

Praveen said...

There are 2 packages that speed up the installation. One is XAMP - package Apache, MySql, Php.

Other one is Apache2Traid.