Installing PHP on Your Development Server

Because you already have WordPress installed, your web server or your web hosting company has PHP on that server. You should have PHP installed on your local computer to develop plug-ins and themes for WordPress for one simple reason: Your blog visitors should not be the guinea pigs while you test new looks and features.

You installed the core PHP language software with XAMPP in Chapter 11, "Installing and Upgrading WordPress Software," but you can always confirm that you have the latest version at http://php.net. To install the latest package in Windows, follow these steps.

PHP4 versus PHP5

There's a small controversy in the WordPress community about the level of support for older versions of PHP. As of this writing, web servers with PHP V4.3 or later can run current versions of WordPress. Considering that v4.3 was released in late 2002, PHP vs.o came out in July 2004, and the current version 5.3 came out in June 2009, you might wonder why WordPress has not updated its system requirements.

PHP 5.0 added object-oriented features to make the language more like C++ and included a new interpreter engine contributed by the Zend Corporation. Over three minor iterations, more features have been added.

For a long time, Matt Mullenweg actively opposed moving to PHP5 on the grounds that it failed to improve on the earlier version and that it had been a flop in the marketplace (see his 2007 essay "On PHP" at http://ma.tt/2007/07/on-php). When the PHP developers ended support for the entire v4.x series in late 2008, adoption increased.

The problem for the WordPress team is that a substantial number of WordPress installations are apparently still running on servers with PHP4.X. At the 2009 WordCamp NYC in New York City, Mullenweg said that approximately 12% of all WordPress sites were still hosted with PHP4. That totals to around 2 million WordPress sites based on the older version of the PHP language. Credit this issue to web hosting companies that are reluctant to "fix what isn't broken." The WordPress development team has indicated that after that percentage dips into single digits, WordPress will likely mandate the language upgrade. With no more security fixes coming for PHP 4, the next security breach against one of these hosts could force the holdout hosting companies to recognize their sites are broken and fix them.

PHP5 also is gaining the feature set to move the v4 laggards to upgrade. Some features included in WordPress 2.9 core run much better on PHP5, like oEmbed and the new time zone support. As a WordPress user, you can appeal to your host to upgrade for these new features. As a theme or plug-in developer, what does this mean for you? The bottom line is: Don't be afraid to use PHP5 to create scripts for themes or plug-ins. All PHP4 features are included in the current version. For themes, it's not much of an issue. If you want to write a plug-in, know the differences between the two versions, however. You can take advantage of PHP5 features (for example, PHP5 is much better at parsing XML data than PHP4) as long as things don't break in PHP4-based systems. As a WordPress user, select a host that already supports PHP5. If you have a host that only has PHP4 installed, ask why. Remind them that there won't be any more security patches for PHP4, and you want your visitors to get the full benefit of embedded multimedia on your site.

Was this article helpful?

0 0

Post a comment