Monday, November 30, 2009

How to convince a potential client?

If you want to use PHP in your company and your manager favours another solution, or if you are trying to convince a potential client that PHP really is a superior choice for the web, you're going to need to have a clear-cut set of reasons why you believe PHP is the superior language. This short list should help you get started:
  • PHP is cross-platform. It can run on Windows, Linux, BSD, Mac OS X, and Solaris, as well as a variety of other platforms.
  • PHP is free. You can download the source code, use it, and even make changes to it without ever having to pay any licensing costs. You can even give away your own modified version of PHP.
  • PHP is fast. In the majority of scripts beyond basic benchmarks, PHP will easily compete with both Perl and Python, and usually match Microsoft's ASP.NET. Add to that the fact that PHP code can be cached for execution, and PHP's performance is first-class.
  • PHP is capable and reliable. There are thousands of pre-written functions to perform a wide variety of helpful tasks - handling databases of all sorts (MySQL, Oracle, MS SQL, PostgreSQL, and many others), file uploads, FTP, email, graphical interfaces, generating Flash movies, and more. It is already running on millions of servers around the world making it reliable in most demanding situations
  • PHP is extendable. Writing your own extension to PHP is a common and easy way to implement speed-critical functionality, and PHP's extension API is a particularly rich and flexible system.
  • PHP is easy to debug. There are a number of debuggers, both commercial and freeware, that make debugging PHP a snap.
  • PHP is advancing. With the release of PHP 5, PHP has introduced features that have long been waited for, including more comprehensive error handling, better object orientation, and, of course, more speed.

The base of the PHP language is very simple, having just enough to set and retrieve variables, work with loops, and check whether a statement is true or not. The real power behind PHP comes with its extensions - add-ons to the base language that give it more flexibility. There are hundreds of extensions to PHP, and they can be broken down into five distinct types: core, bundled, PECL, third party, and DIY.
  • Core extensions are extensions that are bundled with PHP itself, and enabled by default. For all intents and purposes they are part of the base language, because, unless you explicitly disable them (few people do, and sometimes you cannot), they are available inside PHP. For example, the mechanism to handle reading and saving files in PHP is actually handled by an extension that is automatically compiled into PHP.
  • Bundled extensions are extensions that are bundled with PHP, but not enabled by default. These are commonly used, which is why they are bundled, but they are not available to you unless you specifically enable them. For example, the mechanism to handle graphics creation and editing is handled by an extension that is bundled with PHP, but not enabled by default.
  • PECL(pronounced "pickle") stands for "PHP Extension Community Library", and is as a subset of the PHP Extension and Application Repository, PEAR.
  • Third-party extensions are written by programmers who wanted to solve a particular problem that was unsolvable without them creating a new extension. There is a variety of third-party extensions available out there.
  • Finally, Do-It-Yourself (DIY) extensions are simply extensions you created yourself. PHP has a remarkably rich extension creation system that makes it quite simple to add your own code as long as you know C.

Monday, November 16, 2009

Technologies of Web2.0

Next we will examine some of the technological components commonly employed by many Web 2.0 companies when developing and delivering applications. They are also highly portable and can scale very well on commodity-based hardware platforms. Some shared characteristics which make their use appealing to Web 2.0 developers is that they are all free, open source, highly interoperable and perfect for use with dynamic database-backed websites and applications.

The Benefits of Open Source

As mentioned, many of the components that Web 2.0 companies rely on to deliver their applications and services are built on open source components. There are a couple of key benefits that are derived by these companies leveraging software components which are open source in nature.
  • Lower Total Cost of Ownership. This enables lower up front and long-term costs associated with the development, delivery and execution of new business models.
  • Component & Application Freedom: Choosing open source software prevents vendor lock in to specific hardware or software stacks. This high degree of interoperability across hardware and software platforms can also be leveraged against the abundance of tools and applications for use throughout the development cycle, from design and modeling, to testing, versioning and day to day operations management.

LAMP:

Fortunately, there is a proven open source stack which has been consistently leveraged by companies big and small to deliver scalable, cost effective, and interoperable applications. This has been achieved by leveraging the tight integration of Linux – Operating System, Apache – Web Server, MySQL – Database, PHP Programming & Scripting.

Support:

Support for open source components can usually be obtained at no cost from a community of users and developers. It can also be purchased in the form of professional consulting and technical support, which is available by most of the open source vendors, as well as from both large and small ISVs.

Linux

Linux is a Unix-like operating system which is free and open source. All of the source code is available for anyone to use, modify and redistribute. This is in contrast to proprietary operating systems like Windows. Linux has been around since the early 1990’s and has at this point become the fastest growing operating system in the world. Much of this success can be attributed to the fact it is a low-cost, secure, scalable and highly interoperable alternative to proprietary operating systems. Linux can be found running on everything from hand-held devices to hardware components, desktop computers to massive computing clusters. All of these characteristics make it an excellent choice for Web 2.0 applications.

Linux shares a long tradition of compatibility with MySQL and other open source components by serving as the operating system component of the LAMP (Linux, Apache, MySQL, & PHP) technology stack.

Apache

The Apache HTTP Server Project is an open-source Web server. It is known for being secure, highly portable across many operating systems, efficient in utilizing resources and extensible. According to a Web Survey, the Apache Web Server continues to be the world’s most popular web server with over 70% of websites leveraging it within their technology stacks. Apache has been extend with compiled modules for interfacing with Perl, Python and PHP.

MySQL

Within the LAMP stack, MySQL comprises the database component. The database component serves as the critical piece of software which manages the data leveraged by the applications and web servers. MySQL is a multithreaded, multi-user, SQL Database Management System (DBMS) with over six million installations. MySQL is the database of choice for consistently delivering lower TCO, reliability, performance and ease of use.

Many of the largest and fasting growing Web 2.0 companies are designing,developing and going into production using MySQL. As their needs grow in terms of capacity, availability and performance, MySQL continues to assist in satisfying these requirements.

PHP

PHP comprise the dynamic programming and scripting language components of the LAMP stack. PHP Hypertext Preprocessor or simply, PHP, is an open-source language for producing dynamic web content mainly in server-side applications. PHP typically runs on a web server, using PHP code as its input and rendering Web pages as output. PHP is a very popular server-side alternative to Microsoft’s ASP.NET and Adobe’s ColdFusion. PHP works extremely well with all the components within the LAMP stack. According to php.net, it is estimated that over 20 million domains on the internet make use of the language.

Ajax

Asynchronous Javascript and XML or Ajax is it is more commonly known, is a development technique for creating rich, visual appealing and interactive web applications. Web pages which leverage Ajax are more responsive because they exchange smaller amounts of data with the web server. This means that the entire web page does not have to be “refreshed” or completely reloaded in user’s browser after each interaction. This results in web pages which have increased interactivity, speed and usability. These are all key components to help Web 2.0 companies deliver applications which are highly interactive and deliver rich end user experiences which rival those of desktop applications. For these reasons, Ajax is already being widely leveraged in both consumer and business applications.
The core components of the Ajax technique include:
  • XHTML (or HTML) and CSS leveraged for mark up and style information.
  • The description of how an HTML or XML document is represented in a tree structure (otherwise known as DOM), is accessed with a client-side scripting language, usually JavaScript.
  • The XMLHttpRequest object is used to exchange data asynchronously with the web server.
  • XML as the format to transfer data between the server and client.

memcached

memcachced is a popular open source distributed memory caching system originally developed by Danga Interactive for the blogging website LiveJournal. It is traditionally leveraged to enhance the performance and responsiveness of dynamic content websites backed by databases. This is achieved by caching data and objects in memory, thereby reducing the amount of data that needs to be read from the database. The performance characteristics it can deliver are faster page loading for users, more efficient resource utilization, and faster database access times in the event of a memcached miss.

In more technical detail, memcached acts as a large hash table, caching data as it is being requested by clients. Although it was originally designed to improve the performance of database queries, it has been extended to cache server-side objects as well. In essence, any operation which is resource or time intensive can benefit from the use of memcached. It goes without saying that this technology is of great advantage to Web 2.0 applications, who by definition are very dynamic and data driven. This is in contrast to the static non-interactive web sites characteristic of the early years of the Web.

Many websites who make use of memcached, such as LiveJournal, Slashdot and Wikipedia, also make use of MySQL.

Monday, November 2, 2009

Webmaster Tools - website verification

If you use Webmaster Tools, you're probably familiar with verifying ownership of your sites. Simply add a specific meta tag or file to your site, click a button, and you're a verified owner. Some websites and software have features that help you verify ownership by adding the meta tag or file for you. Google recently made a few small improvements to the process that google think will make it easier and more reliable for you.

The first change is an improvement to the meta tag verification method. In the past, your verification meta tag was partially based on the email address of your Google Account. That meant that if you changed the email address in your account settings, your meta tags would also change (and you'd become unverified for any sites you had used the old tag on). Now Google created a new version of the verification meta tag which is unrelated to your email address. Once you verify with a new meta tag, you'll never become unverified by changing your email address.

Google also revamped the HTML file verification. Previously, if your website returned an HTTP status code other than 404 for non-existent URLs, you would be unable to use the file verification method. A properly configured web server will return 404 for non-existent URLs, but it turns out that a lot of sites have problems with this requirement. Now Google have simplified the file verification process to eliminate the checks for non-existent URLs. Now, you just download the HTML file from the webmaster tools section and upload it to your site without modification. Google will check the contents of the file, and if they're correct, you're done.

If you've already verified using the old methods, don't worry! Your existing verifications will continue to work. These changes only affect new verifications.

In future, Google will begin showing the email addresses of all verified owners of a given site to the other verified owners of that site. However, if you're using an email address you wouldn't want the other owners of your site to see, now might be a good time to change it.

For complete details, visit Google Webmaster Central Blog