Home arrow PHP arrow PHP and Python Hit Prime Time

PHP and Python Hit Prime Time

PHP is running as an Apache module on almost 10 million domain names, but where is Python? In this article Nicholas compares and contrasts the two, along with his opinion of each.

Author Info:
By: Nicholas Petreley
Rating: 3 stars3 stars3 stars3 stars3 stars / 5
November 18, 2002

print this article

PHP is running as an Apache module on almost 10 million domain names, but where is Python? In this article Nicholas compares and contrasts the two, along with his opinion of each.It's strange to say that PHP (Hypertext Preprocessor) has only recently reached the point where it's ready for prime time, since PHP is already the most popular Apache module, running on almost 10 million domains (over a million IP addresses).

Nevertheless, I've had some reservations about PHP until recently, especially with respect to potential security holes. Then I downloaded and installed the latest version of FUDforum, an open-source PHP-based Web discussion forum package I use for my nonprofit Web site, VarLinux.org.  But what you should really examine is the PHP code behind FUDforum, which you can download from http://fud.prohost.org.

At some point when I wasn't looking, PHP matured to a point where one could easily avoid the security holes that plagued some old PHP programs. This is especially true if you take an object-oriented approach to building your PHP applications.

Another good example of high-quality PHP programming is phpWebSite (http://phpwebsite.appstate.edu), a Web content management system with several good snap-in expansion modules, including one that lets you create e-mail accounts for CommuniGate Pro, an increasingly popular drop-in replacement for Microsoft Exchange. The CommuniGate Pro e-mail and groupware server (www.stalker.com) has a built-in Web interface for e-mail that you can integrate into the site you manage with phpWebSite.

The only thing I haven't yet seen done well in PHP is an open-source Web-based groupware application. Yahoo did a pretty good job designing its Web-based calendar (http://calendar.yahoo.com). It even allows you to synchronize your data with a Palm device. But most IT departments are going to want to host their own calendars and groupware, and if there's anything that's been done in PHP that is of comparable quality to what Yahoo came up with, I haven't found it. There is at least one decent commercial offering, Internal Affairs (www.internalaffairs.de/en/), and several open-source projects are in the works, a promising one being PHProjekt (www.phprojekt.com). But none of the ones I've tried exploit the maximum potential of the PHP platform.

Love That Python
Of course, there's more to life than PHP. One of my favorite programming languages is Python (www.python.org). It seems I don't go a week these days without someone asking me what I know about Python, so it seems to be gaining quite a following in mainstream IT.

Admittedly, Python is a love-it-or-hate-it language, but those who love it claim to be far more productive than with any other language. Being on the love-it end of the spectrum, I'd argue that it's a well-founded claim.

But Python hasn't gotten much past the promising stage for Web applications development. Until recently, Webware has been the best choice for Python programmers (http://webware.sourceforge.net/). Webware is very nicely done, but its one weakness is that you need to run a Python-based application server in parallel to your Web server. In contrast, PHP integrates directly into the Apache Web server through a plug-in module.

There's nothing inherently wrong with the Webware approach, but it is difficult to tell how much overhead Webware will add to your applications. Webware simply hasn't been around the block as many times as comparable Java-based application servers.

Spyce is a newcomer to the Python Web applications approach, and it may not only push Webware off the map, it could also eventually give PHP a run for its money (http://spyce.sourceforge.net). Spyce lets you embed Python code into your HTML in basically the same way you would if you used Webware and Python Server Pages. But Spyce doesn't need a separate application server to work. Spyce piggybacks off the Python or fast-CGI modules available for Apache.

I haven't done much more than a few minor exercises with Spyce, but so far I'm extremely impressed. The library of Web features for session management, cookies, forms, pooled variables and other Web applications goodies makes it surprisingly easy to toss together a prototype to see if it's worth using for your next project. If you even have a passing interest in Python, I recommend that you give Spyce a look.

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

All PHP Tutorials
More By Nicholas Petreley

blog comments powered by Disqus

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials