Steps for running PHP (version 5) with Apache Tomcat 6 Server on Localhost

One of our readers Mr. Nutan Vishwakarma did some studies on how to run PHP with Apache Tomcat 6 Server. Lets see what he has to say..

Simple Steps for running PHP (version 5) with Apache Tomcat 6 Server on Localhost :

1. Download & Unzip PHP (5.2.6) to a directory, c:\php-5.2.6-Win32
(download location http://www.brothersoft.com/php-68222.html)

2. Download PECL 5.2.5 Win32 binaries
(download location http://www.filewatcher.com/m/pecl-5.2.5-Win32.zip.2948387.0.0.html)

3. Rename php.ini-dist to php.ini in c:\php-5.2.6-Win32

4. Add extension=php_java.dll in Dynamic Extensions section in php.ini

5. Extract php5servlet.dll from PECL 5.2.5 to c:\php-5.2.6-Win32

6. Extract php_java.dll from PECL 5.2.5 to c:\php-5.2.6-Win32\ext

7. Create a directory named forphp (any name you like) in tomcat\webapps directory.

8. Extract phpsrvlt.jar from PECL 5.2.5 to tomcat\webapps\forphp\WEB-INF\lib

9. Unzip phpsrvlt.jar

10. Modify both net\php\reflect.properties and net\php\servlet.properties to library=php5servlet

11. Pack phpsrvlt.jar

12. Create web.xml in tomcat\webapps\forphp\WEB-INF as following:

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd ">
<servlet>
<servlet-name>php
<servlet-class>net.php.servlet
</servlet>
<servlet>
<servlet-name>php-formatter
<servlet-class>net.php.formatter
</servlet>
<servlet-mapping>
<servlet-name>php
<url-pattern>*.php
</servlet-mapping>
<servlet-mapping>
<servlet-name>php-formatter
<url-pattern>*.phps
</servlet-mapping>
</web-app>

13. Add php path to the system variable named path

14. Create phptest.php for testing under tomcat\webapps\forphp as following

<?php phpinfo(); ?>

15. Startup tomcat

16. Visit http:\\localhost:8080\forphp\phptest.php
(You should see php info if everything works properly)

Thanks for Reading my POST.

References :
http://www.softminer.net/2009/05/how-to-install-or-run-php-on-tomcat-6.html

MySql : How to Reset Auto Increment Starting Value?

Recently I've been doing a project using MySql database server. I created some tables using auto increment number as the Primary Key.

As the name suggests, the auto increment number will increase every time I insert a new record into the table.

After some point, i wanted to delete all the dummy data i had inserted.

I used DELETE FROM TABLE_NAME statement to delete all the rows.. It removed all the records but did not reset the auto increment number to 1 again.

After a little research i found 2 useful ways to do the needful.

1) After deleting all the rows using DELETE FROM TABLE_NAME statement, use this simple syntax to reset the number :

ALTER TABLE TABLE_NAME AUTO_INCREMENT = 1

OR

2) You can use the statement TRUNCATE TABLE TABLE_NAME. This will remove all the records from the table and will automatically reset the number to 1.

While researching i also found that TRUNCATE statement is quicker than the DELETE FROM statement. This is because the TRUNCATE statement actually drops the table and recreates it. Whereas DELETE FROM statement deletes the records one by one, and is hence slower. Thus, its advisable to use TRUNCATE statement in the scenarios where you want to remove all the records of a table.


I hope you will find this solution useful.. :)

References :
• http://cookingprogrammers.blogspot.com/2008/03/mysql-to-reset-auto-increment-number.html
• http://www.electrictoolbox.com/article/mysql/delete-all-data-mysql/

3rd Software Project for Taj Hotels Chain

It is my pleasure to inform to our readers that we have got the privilege to consult and implement on system wherein all the trainings happening in the hotel are recorded and maintained online at a centralised location.

The system would be named "GYAANPUR" which is taken from the earlier running system on excel files and papers.

It is going to be implemented firstly in Taj Lands Ends, Bandra, Mumbai.

We would keep updated about our progress over the same.

Wish us all the very best.

MySQL- A SOLUTION TO MANY PROBLEMS

This wonderful article about the basics of the well known database management software is provided by an expert in her area of working. Ms. Kanchan is in the industry wherein MySQL is extensively used. Lets understand what she has to say.


.............. In today’s scenario, computers have become a very integral part of our day to day life. You can utilize computers to store oodles of data in different types and number of files. However, to access this data from assorted files and analyze is it a tedious task.



But you can spare yourself from such a tedious task by simply using a popular relational database management, MySQL, a product of Sun Microsystems Inc.. Also known as My Structured Query Language, MySQL is a popular open source database available as a freeware as well. It is written in programming languages, C and C++ and works on various platforms.



In MySQL, the data is stored in the form of structured tables making it easier to understand, query and analyze information. You can access, store, modify and process information varying from basic household expenses to data of huge corporate houses. In addition, you can store data from a single character to documents, graphic files etc,



Being an Open Source database system, you can use and even modify the MySQL software as per your requirements. You can study the source code and personalize the software. However, the source code is available under the GNU General Public License (GPL) that defines the limitations to which you can personalize the software. Alternatively, you can embed a MySQL code into a commercial application by purchasing a licensed version. You can access more information on the limitations of the source code from http://www.mysql.com/company/legal/licensing/.



In addition, you can host information stored in a MySQL database on a web server making it accessible anywhere in the world. By hosting the database over net, you can access, modify or analyze data at any time.



MySQL provides various products such as:
  • MySQL Enterprise: is a comprehensive offering of production support, monitoring tools and database software that delivers optimal performance, reliability, security and uptime. It includes the MySQL Enterprise Server and MySQL Enterprise Monitor softwares, and MySQL Production Support.
  • MySQL Cluster: is only true real-time database that combines the flexibility of a high availability relational database
  • MySQL Embedded Server: is a full-featured, zero administration database that over 2000 ISVs, OEMs, and VARs rely on to make their products more competitive, bring them to market faster, and lower their COGs (cost of goods sold)
  • MySQL Connectors: provides standards-based drivers for JDBC, ODBC, and .Net enabling developers to build database applications in their language of choice
  • MySQL Workbench: enables a DBA, developer, or data architect to visually design, generate, and manage all types of databases including Web, OLTP, and data warehouse databases.

For more information on these products, click http://www.mysql.com/products/.

Proxy Server - an intermediary !!



In a network, a proxy server is the entity that sits between corporate client machines and the Internet. For example, it may sit between a client application, such as a Web browser and the corporate server. Proxies are used to intercept incoming and outgoing requests to see if it can fulfill the requests itself. If not, it then forwards the request to the real server.




The most common types of proxy servers are called Forward and Reverse proxies:
A forward proxy is used to forward outgoing requests from a private network or intranet to the Internet, usually through a firewall. The main goal of the forward proxy is to provide a level of security and also to reduce network traffic.
In contrast, a reverse proxy handles requests coming from the Internet to the private network or intranet. This provides a level of security that prevents the Internet clients from having direct access to data on the corporate servers.

Your browser may not support display of this image.

Most large businesses, organizations, and universities these days use a proxy server. This is a server that all computers on the local network have to go through before accessing information on the Internet. By using a proxy server, an organization can improve the network performance and filter what users connected to the network can access.


Usage:

A proxy server improves Internet access speeds from a network primarily by using a caching system. Caching saves recently viewed Web sites, images, and files on a local hard drive so that they don't have to be downloaded from the Web again. While your Web browser might save recently viewed items on your computer, a proxy server caches everything accessed from the network. That means if User1 views a blog article at www.blog.techyoddha.com at 1:00 and User2 views the same page at 1:03, he'll most likely get the page straight from the proxy server's cache. Though this means super-fast access to Web pages, it also means users might not be seeing the latest update of each Web page

The other main purpose a proxy server is to filter what is allowed into the network. While HTTP, FTP, and Secure protocols can all be filtered by a proxy server, HTTP is the most common. The proxy server can limit what Web sites users on the network can access. Many organizations choose to block access to sites with objectionable material such as hacking information and pornography, but other sites can be filtered as well. If an employer notices workers are spending too much time at sites like eBay or orkut.com, those sites can be blocked by the proxy server as well.


References:
  • http://www.webopedia.com/TERM/P/proxy_server.html
  • http://www.techterms.com/definition/proxyserver
  • http://www.webopedia.com/quick_ref/proxy_server.asp
  • http://whatis.techtarget.com/definition/0,,sid9_gci212840,00.html

Gmail is no more 'Beta' !!

Good Bye! to Beta
Google has removed the 'BETA' label from its very famous email service called Gmail. This is also applicable to Google Calendar, Google Docs, Google Talk, and Google Video for Business. The move is seen as a way to attract large businesses to Google Apps (its suite of messaging and productivity applications).

Released on April 1, 2004, Gmail was still in beta five years and tens of millions of users later.


According to Google it has beefed up the Google Apps suite by adding offline access to e-mail and calendars and streamlining access to Google Apps for BlackBerry users.
Google also says that its Web-based messaging platform is now more compatible with Microsoft Outlook and it has improved contact management for Google Apps.



What is Beta ?
The term "beta" refers to a piece of software or web application that's still being developed.
Expect problems with betas and you won't be surprised, but enjoy the thrill of being among the first to use a new bit of software.
If you don't like those kinds of thrills wait until the software is "out of" beta.


The beta version of a software release is considered to be a preview. It has all the standard features, but is not yet ready for wide release or sale. During this point, the company will collect feedback from users about the product's usability — what they like and what should be changed — before the product's wide release.



What Google representatives say ?
.......... by no means does the removal of the beta label mean Google will stop innovating and experimenting with new features offered through Google Labs for Gmail, Google Calendar, and other Google App services. They say existing Google Labs users can re-enable the beta label for Gmail from the Labs tab under Settings.



Reference:
http://www.sfgate.com/cgi-bin/blogs/sfgate/detail?blogid=19&entry_id=43121