Monday, February 4, 2008

Web Application/ PHP-MySQL

Installing PHP on Windows

1. Extract the files from the .zip file into the directory where you want PHP to be installed, such as
c:\php
.

If you double-click the .zip file, it should open in the software on your computer that extracts files from .zip files, such as WinZip or PKZIP. Select the menu item for extract and select the directory into which the files are to be extracted. C:\php is a good choice for installation because many configuration files assume that’s where PHP is installed, so the default settings are more likely to be correct. It’s best not to install PHP in a directory with a space in the path, such as in Program Files/PHP. Doing so can cause problems.You now have a directory and several subdirectories that contain all the files from the zip file.

2. Copy the file required for MySQL to the PHP main directory.

The file is located in the ext subdirectory in the directory where PHP is installed. Copy one of the following files, depending on which version of MySQL you’re using:

ext\php_mysqli.dll (for MySQL 4.1 or later)

ext\php_mysql.dll (for MySQL 4.0 or earlier)


Copy the file into the main PHP directory, such as c:\php.

Another file, named libmysql.dll, is required for MySQL support. This file should already be located in the main PHP directory. If it isn’t, you need to find it and copy it there. If it’s not in your PHP directory, it’s usually installed with MySQL, so find it in the directory where MySQL was installed, perhaps in a bin subdirectory, such as c:\Program Files\MySQL\MySQL Server 5.0\bin. Occasionally PHP needs DLL files that it can’t find. When this happens, PHP displays an error message when you run a PHP program, saying that it can’t find a particular DLL. You can usually find the DLL in the ext subdirectory and copy it into the main PHP directory.


Configuring your Web server for PHP

Configuring IIS :

To configure IIS to work with PHP, follow these steps :

1. Enter the IIS Management Console.

You should be able to enter by choosing Start Programs Administrative Tools Internet Services Manager or

StartControl Panel Administrative Tools Internet Services Manager.

2. Right-click your Web site (such as Default Web Site).

3. Select Properties.

4. Click the Home Directory tab.

5. Click the Configuration button.

6. Click the App Mappings tab.

7. Click Add.

8. In the Executable box, type the path to the PHP interpreter.

For example, type c:\php\php-cgi.exe.

9. In the Extension box, type . php

This will be the extension associated with PHP scripts.

10. Select the Script Engine check box.

11. Click OK.

Repeat Steps 6–10 if you want any extensions in addition to .php to be processed by PHP, such as .phtml



Configuring PHP

PHP uses settings in a file named php.ini to control some of its behavior.

If the php.ini file isn’t installed during installation, you need to install it now. A configuration file with default settings, called php.ini-dist, is included in the PHP distribution. Copy this file into the appropriate location, such as the default locations just mentioned, changing its name to php.ini.



1. Open the php.ini file for editing.

2. Change the settings you want to change.

Steps 3, 4, and 5 mention some specific settings that should always be changed if you are using the specified environment.

3. Only if you are using PHP 5 or earlier, turn off magic quotes.

Look for the following line:

magic_quotes-gpc On

Change On to Off.

4. Only if you are using PHP 5/6 on Windows, activate mysqli or mysql

support.

Look for a list of extensions. Find the line for the mysqli extension, as

follows:

; extension=php_mysqli.dll

If you are using a version of PHP earlier than 5.0 or a MySQL version earlier

than 4.1, find the following line:

;extension=php_mysql.dll

Notice the semicolon (;) at the beginning of the lines. To activate the

extension, remove the semicolon. If the extension line isn’t in your

php.ini file, add it.

5. Only if you’re using PHP on Windows with the IIS Web server, turn

off force redirect. Find the line:

; cgi.force_redirect = 1

You need to remove the semicolon so that the setting is active, and also

change the 1 to 0. After the changes, the line looks as follows:

cgi.force_redirect = 0

6. Save the php.ini file.

7. Restart the Apache server so that the new settings go into effect.


Your required configuration is complete.

Now Enjoy using PHP/ MySQL in Windows, codes will be available soon.............











Friday, January 11, 2008

ASP.NET/ Some Ideas

INTRODUCTION

Before telling what ASP .NET is we have to understand what kind of website is usually referred to as a dynamic website.

Literally, websites which have their pages dynamically created as per the requests placed on the web server are called dynamic web sites and Web pages in those websites whose content is produced or generated dynamically based on user input or other information are called dynamic web pages. Examples for such websites are search engines, discussion forums etc where the output page is generally produced by the web server on the fly as per the requests.

So how does the web server serves dynamic WebPages as per requests ?

That is where the magic of Server Scripting languages comes in. These scripting engines sits behind the web server and as per the developer has instructed them to react, they generates HTML code as per the demands in the requests from clients passed on to them by the web server. They usually pulls contents from some data storages like files or database servers according to the conditions specified in the requests and spins off HTML code which is then served back to the client by the web server.

There is a lot of Web scripting technologies that the developer can make use of and ASP .NET is one of them. Yes, so now you come to know that ASP .NET is nothing but a scripting engine, which is sitting on a web server ready to serve the web server with dynamically generated content, which in turn is utilized by the web server as responses to client machines. It is the web server which decides whether a request needs the service of the Scripting Engine or not. It usually decides this by looking at the extension of the requested files and ASP .NET files usually have an extension of .aspx.

How a webserver with ASP .NET serves a dynamic webpage



How a webserver with ASP .NET serves a dynamic webpage