Archive for January, 2010

PHP Performance Test : Linux & Windows

Identical Hardware was used to make the tests.

  • Intel Core2Duo 2.4 GHz
  • 2 GB DDR2 RAM
  • 160 GB SATA 7200 RPM
  • Windows Server 2003/Ubuntu

PHP on Linux Versus PHP on Windows

  • RAW statement execution is faster on Windows.
  • Function Calls are faster on Windows
  • Object Creation & Access are faster on Linux with PHP 5.2 but faster on Windows with PHP 5.3
  • Library calls are faster on Linux. (Example: Encryption process is 3-5 times faster on Ubuntu.)
  • File Access is faster on Linux by a small percentage, except for file copy operations which is as much as 60% slower on Windows probably due to the ACL advanced security.
  • MySQL access with Linux is faster by more than a little and on Windows, MySQL access deteriorates in version 5.3
  • PostgreSQL performance is very close on both platforms (within 6/100 of a second for 1000 Operations) – It’s faster on Windows and faster still on Windows with PHP 5.3
  • MS SQL Server access from PHP 5.2 on Windows is marginally slower than MySQL access on Linux.

Dumping The MySQL database using PHP

If your web hosting provider does not keep the daily backups of your MySQL databases, then you need to think of taking the daily backups to avoid the risk of data loss. Backing up the database is very simple process if your do that using PhpMyAdmin or MYSQL administrator. However, this manual process sometimes may make you feel bored doing the same task daily. Hence, it is better to create the web page that takes the backups automatically. You just need to visit the backup generation page once a day. And it will dump the mysql backup for you. Here is the sample script that dumps the MYSQL database.

<?php
//~ Must edited values

//~ MySQL
$SQL_USER=’username’;
$SQL_PASS=’password’;
$SQL_DB=’database’;

//~ * Back up mail
$MAIL=’your@email.com’;
$SUBJECT=’backup’;
$MESSAGE=’backup’;

//~ * MySQL dump, then zip.
shell_exec(“mysqldump -u $SQL_USER -p$SQL_PASS $SQL_DB $SQL_DB.sql”);
shell_exec(“zip $SQL_DB $SQLDB.sql”);

//~ * Send mail with attachment.
$OB=’—-=_OuterBoundary_000?;
$IB=’—-=_InnerBoundery_001?;
$headers=”From: $MAIL\r\n”
.”MIME-Version: 1.0\r\n”
.”Content-Type: multipart/mixed;\n\tboundary=\”$OB\”\n”;
$Msg=”This is a multi-part message in MIME format.\n”
.”\n–$OB\n”
.”Content-Type: multipart/alternative;\n\tboundary=\”$IB\”\n\n”
.”\n–$IB\n”
.”Content-Type: text/plain;\n\tcharset=\”iso-8859-1\”\n”
.”Content-Transfer-Encoding: quoted-printable\n\n”
.$MESSAGE
.”\n–$IB–\n”
. “\n–$OB\n”
.”Content-Type: application/octet-stream;\n\tname=www.zip\n”
.”Content-Transfer-Encoding: base64\n”
.”Content-Disposition: attachment;\n\tfilename=www.zip\n\n”
.chunk_split(base64_encode(file_get_contents($SQL_DB.’.zip’)))
.”\n\n”
.”\n–$OB–\n”;
mail($MAIL, $SUBJECT, $Msg, $headers);
//~ * Completed message
echo ‘done’;
?>

Windows Cache Extension For PHP By Microsoft

Windows Cache Extension for PHP has been released by Microsoft. It is currently in its Beta version. If you are heavily dealing with PHP applications on Windows platform, then this is the very cool thing for you. Your PHP applications can run faster than ever even on Windows Platform. It is only available forPHP 5.2.X, Non-thread-safe build and PHP 5.3 X86, Non-thread-safe VC9 build. One another requirement is that this cache extension runs only and only if the IIS is configured to execute PHP with FastCGI.

Supported Configurations

  • Windows XP SP3 with IIS 5.1 and FastCGI Extension
  • Windows Server 2003 with IIS 6.0 and FastCGI Extension
  • Windows Vista SP1 with IIS 7.0 and FastCGI Module
  • Windows Server 2008 with IIS 7.0 and FastCGI Module
  • Windows 7 with IIS 7 and FastCGI Module
  • Windows Server 2008 R2 with IIS 7.0 and FastCGI Module
  • As the name itself suggests, this is the caching technique that results into the better performance. Every PHP request does not need to ask for the same resource from the same source as the resource is cached.

Available cache extensions are Windows Cache Extension 1.0 for PHP 5.2 – Beta and Windows Cache Extension 1.0 for PHP 5.3 – Beta

Installation of this cache extension is very easy. Here are the steps.

  • Download and copy the DLL file
  • Place it at \ext directory of your php installation
  • Update the php.ini file and add extension extension = php_wincache.dll
  • Refresh the application pools and restart necessary services
  • PHP caching techniques available are PHP opcode cache, file cache and relative file path cache.

Oracle Enterprise Linux and Zend Server For High Reliability and Performance

Oracle and Zend have a long-standing commitment to the PHP community, with a history of collaboration that has ensured integration between Oracle and Zend’s PHP solutions. Oracle Database, Application Server and JDeveloper tool, with a PHP extension, all support PHP development. A sizeable percent of Zend customers use Oracle Database infrastructure to develop and deploy enterprise PHP applications.

Oracle and Zend deliver a reliable, high performance Linux and PHP environment for running business-critical Web applications.

  • Oracle customers can easily install and update Zend Server from Oracle Unbreakable Linux Network (ULN) through standard, native RPM package delivery (http://linux.oracle.com)
  • Zend Server includes out-of-the-box connectivity to Oracle Database, minimizing the time required for set up
  • Full support for applications and production environments running on Oracle Enterprise Linux and Zend Server is available via Oracle (for Oracle Enterprise Linux) and Zend (for Zend Server)

Sources:
http://www.zend.com/products/server/
https://linux.oracle.com/pls/apex/f?p=101:3

Web Service Automates WordPress Password Cracking – Blog Hacking As A Service !!

Hackers have developed a distributed Wordpress admin account cracking scheme that poses a severe risk for the security of blogs whose owners select insecure passwords.

PHP scripts located on a virtual server run bruteforce (password guessing) attacks on targeted sites. Many sites can be attacked at the same time by the system, with results written into an associated database.

The SANS Institute’s Internet Storm Centre notes that brute force attacks against Wordpress are commonplace. The distributed nature of the latest attack marks an evolution towards blog hacking as a web service, however, thus marking it out from the crowd.

“While this particular version is relatively simple, the power behind the script and the MySQL database allows the attacker to distribute the attacks not only by sites, but also by passwords tried as well,” ISC security watcher Bojan Zdrnja writes.

Blog administrators are advised to use strong (hard to guess) passwords and to limiting access by IP address as a security precaution to prevent getting pwned.

New Features Of ImageGlue 7.0

New Features of ImageGlue 7.0

  • Support for 64-bit systems.
  • ImageGlue now incorporates the PostScript rendering engine as used by ABCpdf, our PDF component, which has proven to be fast, robust and accurate. This greatly improves support for importing and exporting PS, EPS, and PDF files, and also enables you to make use of powerful PostScript drawing operations for drawing to canvas.
  • Leveraging ABCpdf’s powerful vector graphics import and export functionality also makes it possible to interoperate with XPS and MS Office documents.
  • An improved API with new classes, methods and properties, more in keeping with normal .NET development.
  • Plus of course the usual range of bug fixes and minor enhancements.

When it comes to manipulating images dynamically there are few toolkits that can compete with ImageGlue 6 in terms of versatility and performance.

With extensive support for a huge range of graphic formats including JPEG2000, Very Large TIFF Support™, and fully multi-threaded processing, ImageGlue has proved a popular choice for use in ASP and ASP.NET server environments.

Now ImageGlue 7 has arrived, introducing support for 64-bit systems, improved PostScript handling, and many other enhancements.

They have also used the opportunity to revise the API, to make it more friendly and familiar to .NET coders. But don’t worry about rewriting legacy code – you’ll find the ’string parameter’ interface is still available through the WebSupergoo.ImageGlue6 namespace.

Website Optimization Techniques

As well as link building and on-page optimisation, there are some other very important SEO factors which can help your website index and rank in search engine listings. The following techniques are grouped into the category named ‘website optimisation’ and should not be overlooked when preparing an SEO campaign.

Domain Age and Expiration Date

Google and other search engines include many factors within their ranking system. One of these factors is trust rank. Owning a domain that has history improves the trust rank as does registering the domain for a long period of time.

Website History

Again trust rank comes into play here. If your website has been archived in the search engine results for a long period then it will help improve rankings and indexing of webpages created in comparison with a fairly new website with no history.

Structured Navigation

When creating a website, it is important to provide a well structured navigation, not just for users but also to allow search engine bots to follow links and index webpages within your website. Structuring your navigation correctly can help all you webpages be indexed and should help the flow of Google’s PageRank spread through out the website.

Valid HTML

As with structured navigation, the importance of valid HTML to search engine bots is to allow all webpages within your website to be indexed within the search engine listings. Validating your HTML will ensure that the bots do not hit any ‘brick walls’ within the code that prevent them from reading the rest of the webpage.

Contextual Linking

To further help the indexing of your webpages and to even out the flow of Google’s PageRank, it is useful to include links within the content text of your webpages. Wikipedia is a perfect example of how this should be done.

URL Structure Including keywords in your website’s URLs will help you rank for those terms. If your website uses dynamic URLs created through variables then think about rewriting them. Separate keywords using a minus character (eg. search-phrase.html) and try and keep the important keywords as close to the beginning of the URL as possible.

Regional Targeting

If you wish to target a certain region then there are a few steps you can take to help this process. Firstly you can choose a relevant domain such as a .co.uk (UK) or .de (Germany) rather than a generic .com domain. Then look at your hosting IP location, search engines can access this information and will use it to decide your target audience. Finally, Google Webmaster Tools allows you to set a geographic target which is useful if you have a .com domain.

Site Maps

Search engine bots look for site maps when they visit your website. Providing a standard HTML site map will help improve the indexing of your webpages and allow bots to find webpages that they might otherwise have missed. You can now also provide and submit an XML site map which all the major search engines have took on as a standard. Use your robots.txt to tell bots where to find your XML site map and also submit it to Google Webmaster Tools and Yahoo Site Explorer.

Domain Name

If you are purchasing a domain name for a new website then think about including your main targeted keywords within that domain name. For example if you are building an online store that sells low price golf clubs in the UK and you buy the domain cheapgolfclubs.co.uk then you are definitely going to have a lot more of a chance for quickly ranking well for the search term ‘cheap golf clubs’ in UK search engines than you would with a more generic domain name. You would also do well for long tail search terms such as ‘cheap golf clubs in the UK’ and have more chance of ranking for ‘golf clubs’ in the long term.

Mozilla Firefox 3.6 RC2 Released

Mozilla Firefox 3.6 RC2 Released

The award-winning Web browser is now faster, more secure and easier to configure the Web. In Firefox 3, we have added many new features that make your online experience. Download Firefox 3 now and start using the Internet to the maximum.

The new version allows you to easily import bukmarki, user profile and customize your start page. This browser was created based on the engine Mozila, only he had discarded extra modules, advertising. Optimized kernel, allowing smaller size and increased speed.

Firefox allows you to surf faster, safer, and much more efficiently. For more than 40 million users have chosen him as their regularbrowser . In Firefox is a function of importatsii favorite and installations of IE, Opera, so you will not have to re-configure everything, and just download and you can already feel the charm of thebrowser. Spreading this wonderful web-browser is absolutely free.

Features
- Viewing sites in tabs

You can work with several Web-pages within a single window.

- Pop-up Blocker
You will no longer annoying pop-up windows open when you visit many sites. You are free to specify which sites to allow pop-ups, and from what does not.

- Safety
You are spared from the various spyware programs, as well as elements of ActiveX. You can independently control their privacy, flexibility to manage personal data. The browser allows you to instantly remove the traces of their stay in the network.

- Smart Search

Search bar, located next to the line input allows you to search all this worldwide network. You can use multiple search engines.

- Live Bookmarks
Support for RSS technology is built into the browser. Create live bookmarks, and be aware of all the latest developments in the world.

- Quick and easy downloads
Downloadable from the Internet files are automatically placed on your desktop. What could be simpler?

- Automatic update
You no longer need to manually download the new version of the browser as they become available. The system updates automatically loads the small patches a few hundred kilobytes in size, saving you time.

- The optimal base composition
Simple, intuitive browser has everything that you may need in everyday life. Bookmarks, history, full-screen mode, zoom text and much more – all this takes place in Mozilla Firefox.

- Extensibility
Mozilla Firefox – the most extensible and customizable browser on the planet. You can customize the toolbar to attach additional expansion modules and theme. Like telescopic fishing-rod, Mozilla Firefox can be transformed from a small browser in a remarkably compact multipurpose tool for travel on the web.

- Developer’s best friend
Mozilla Firefox has a standard set of tools for developers, including console, javascript and CSS. Additional module Document Inspector provides detailed information on Web pages.

Firefox 3.6 is built on Mozilla’s Gecko 1.9.2 web rendering platform, which has been under development for several months and contains many improvements for web developers, Add-on developers and users. This version is also faster and more responsive than previous versions, and has been optimized to run on small device operating systems such as Windows CE and Maemo.
* This beta is available in more than 50 languages – get your local version.
* Users can now change their browser’s appearance with a single click, with built in support for Personas.
* Firefox 3.6 will alert users about out of date plugins to keep them safe.
* Open, native video can now be displayed full screen, and supports poster frames.
* Support for the WOFF font format.
* Improved javascript performance, overall browser responsiveness and startup time.
* Support for new CSS, DOM and HTML5 web technologies.

Facebook Donates $1 per Status Update to Haiti Relief

A reader writes: “I keep seeing this note in status updates. Is it true?” The note says:

This status is being tracked, the owners of facebook have confirmed they will send $1 to the rescue fund for the Haiti earthquake disaster for every time this is cut and paste as a status. You only have to leave it for a minimum of 1 hour. Lets all do our bit to help.

Here’s another version (verbatim):

Too All Members, if you believe in helping people lets do this: PLEASE NOTE that this status is being tracked, the owners of facebook have confirmed they will send $1 to the rescue fund for the Haiti earthquake disaster for everytime this is cut and pasted as a status. You only have to leave it for a minimum of 1 hour….

It’s a hoax. Facebook has announced no such program, and considering the size of the donation the company would be obliged to make if a large percentage of its membership participated, they would have made a public announcement.

Facebook’s Randi Zuckerberg did unveil a Global Disaster Relief initiative last week to “spotlight efforts on Facebook to help respond to disasters around the globe.” There was no mention of a $1-per-status-change donation.

iPhone 2010 To Have Touch-Sensitive Casing

iPhone 2010 reports, rumors and predictions are likely to come in a steady stream for the foreseeable future. The latest comes from analyst firm Goldman Sachs. In an interview, analyst Robert Chen said that the next version of the iPhone will include not only a better camera, but a touch-sensitive case. “Apple’s going to put a lot of innovation, not just on the hardware, but also on the software of the new iPhone.”

Despite the success of the iPhone 3G and iPhone 3GS, Apple’s competitors have taken the fight to Apple’s front door and are offering more feature-rich devices. Most of the Android devices announced in the last three months come packing 5 megapixel cameras and some have the ability to record HD video. That trounces the iPhone’s 3.2 megapixel camera and VGA video capturing capabilities. Any bump in the iPhone’s camera will simply be matching the competition rather than besting it.

A touch-sensitive casing, on the other hand, could offer something unique. Goldman’s Chen doesn’t elaborate on what he means, but given Apple’s forays into touch controls for its products, there are all sorts of possibilities. Gestures could be used to answer/end calls, unlock the device, alter settings, and more. There will be some practical limitations, but even a few simple features would be enough to set the iPhone apart from the swelling competition.

Both Google and Microsoft are doing some interesting things with their unlock screens and notification bars that best what Apple is offering. The next-generation iPhone not only needs to make big steps in hardware, but also in the software. Chen notes that the next iPhone will likely have new software on board that will reflect forthcoming changes to the iPhone Apps Store.