Yahoo Goes PHP in Open Source Embrace

Mega portal Yahoo has switched to the PHP scripting language for its back-end programming, a decision that’s sure to bring smiles to the faces of open-source advocates.

The Sunnyvale, Calif.-based Yahoo is undergoing a switch from a proprietary system written in C/C++ to PHP for its backend scripting, according to a company engineer in a case study presented this week at the PHPCon 2002 conference.

Michael Radwin, who is co-leading the PHP crusade at Yahoo, told the conference that Yahoo’s size and complicated server-side software made the switch to PHP a no-brainer, pointing to the huge savings cost associated with migrating to an open-source platform.

He said Yahoo, which serves more than 1.5 billion page views a day, had already adopted open-source software like Perl, Apache, and FreeBSD, to run its 74 Web properties, which includes 25 international sites.

Back in 1994, when Yahoo was launched, Radwin said free technologies like PHP did not scale and were considered too “immature” to run large, complex destinations. However, the growth of the open-source movement has spurred a change in thinking because languages like PHP aid performance and integration, he explained.

The Apache-backed PHP project, which was created in 1995 by Rasmus Lerdorf, has seen startling usage growth since 1999 and its adoption by a high-profile Web property like Yahoo has sent tongues wagging in the developer community.

Because PHP is embedded within tags, code writers can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. PHP is shipped standard with a number of Web servers, including RedHat Linux.

Radwin, who has worked as a Yahoo engineer since 1998, said proprietary scripting language became a “pain in the neck to maintain and use” and was difficult to integrate with third-party software. He said coding in C++ was too cumbersome and prone to buffer overflows, making it a security risk for Yahoo.

Yahoo, which has felt the financial crunch from the online advertising recession and has been dabbling with paid services to stem the flow of red ink, said cost savings drove the PHP migration plan.

“Yahoo is a cheap company. (We) can’t afford to waste engineering resources (on proprietary coding),” Radwin said, adding that the company first moved to embrace open-source technology back in 1996 when it replaced the Filo server with Apache. Since then, the company has moved some of its database management from Oracle to the open-source MySQL.

“Server-side languages is the natural next step,” Radwin told the conference, touting improved features, performance and integration within PHP. Yahoo chose PHP ahead of alternatives like Perl, ASP or Cold Fusion mostly because it was designed for server side Web scripting and because of the large, open-source developer community that has helped improve the integration and training of software engineers.

He said “simple and clear syntax” in the PHP language fit perfectly with Yahoo’s plans, adding that tests done by the portal were very successful.

Yahoo has already started using PHP for new properties, like the site which was created as a September 11 tribute. Other early adopters of PHP at Yahoo included the PayDirect Site, the Classifieds – “Express” premium service, the personalized Yahoo News feature and almost the entire Yahoo Travel site.

Radwin said the migration of existing sites would be slow and gradual. “We have no plans to rewrite the entire site,” he said. Yahoo would spend the coming months mixing PHP, Apache DSOs, yScript1 and yScript2 pages, he said.

While the Yahoo move is sure to win friends within the open source community, industry watchers worry the cost to migrate everything to PHP could be prohibitive.

Yahoo officials could not be reached to comment on the overall cost of the migration but some analysts are estimating the cost to run into millions of dollars.