CRM Newsletter
 
NEWSLETTERS
 

CIO.com updates, insights and advice on technology, management and your career.

 CIO BlackBerry News and Tips
 CIO Research and Analysis
 CIO Microsoft
 CIO Insider
 
 
 
LEADERSHIP
 
CIO Executive Programs
The Leader in Face-to-Face Education for Senior Executives

Offering regional and national programs, CIO (and CSO) events bring together some of the most respected names and thought leaders in information technology and security. Presented by CIOs and other senior level executives, these invitation-only programs offer timely topics and strong networking. Learn More »

 
CIO Executive Council
A Peer-Advisory Service and Professional Association for CIOs

Public Council Teleconference: Application Rationalization — Hidden Costs and Smart Decisions

November 17 at 11:00 am US/Eastern (GMT-5)

Join Honorio Padrón, of The Hackett Group, who will share the drivers for companies to tackle application rationalization and the results of research that define the hidden cost of complexity. Additionally, we will discuss key decision milestones—to start or not, holding the course steady and fulfilling expectations.

Virtual Desktop Cost-Benefit Analysis — Michael Jacobs, Catlin Group

The analysis contained in this presentation measures the cost of everything from the machines and licenses to the infrastructure for virtual vs. traditional desktop environments.

Honor your best senior team members - Apply for the CIO Ones to Watch Award

Get well-earned public recognition for your top up-and-coming team members, your IT organization and your enterprise. Award winners will be announced, publicized and feted in May 2010, great timing to help attract new IT recruits to your company.

More / Register »

Learn more about the CIO Executive Council »



 
 
RESOURCE CENTER
 
 
 
 

You Used PHP to Write WHAT?!

PHP may be the most popular Web scripting language in the world. But despite a large collection of nails, not every tool is a hammer. So when should it be used, and when would another dynamic programming language be a better choice? We identify its strengths and weaknesses.

 

January 25, 2008CIO

There is no single right answer to every problem and PHP is no exception. The dynamic programming language has its strengths and its weaknesses like any other language. PHP integrates very well with HTML and has hundreds of functions that make it a very capable programming language for a variety of tasks. It also has the ability to interact with the operating system like a scripting language. PHP is also widely held as the way to interact with databases of almost every type.

PHP is the go to guy for Web programming languages but are there things better left to Perl, Ruby, Java, JavaScript or Python? You bet there are. In particular, PHP is not thread safe—which means that multiple instances of the same routine may interact with each other, resulting in a crash on the Web server. PHP has suffered its share of security problems, and it isn't particularly well-suited to large or extremely complex site implementations.

Despite some of its significant shortcomings, PHP is perhaps the most popular Web scripting language currently used in the world. Why is that? Some of the reasons may surprise you.

Editor's Note: As the number of comments on this article demonstrate, several readers disagreed with our author's opinions. Those readers may wish to also read our followup article: PHP's Enterprise Strengths and Weaknesses, Take 2, in which Zend's John Coggeshall responds with his own list of the Good, the Bad and the Ugly of PHP application development.

PHP's Shining Beacon

Several dynamic or "scripting" languages, including PHP, Perl, Java and others, have their roots in the C language, which makes them a natural fit for developers making the transition from traditional application programming to Web programming. This makes the learning curve far less steep for those used to standard procedural languages. PHP has the advantage since it also integrates very well with HTML.

In fact, its full name is PHP: Hypertext Preprocessor (one of those famous Unix recursive acronyms), which means that it understands hypertext (HTML) without any special API or modifications. An API, application programming interface, is a set of libraries that allow programmers to interact with operating systems, databases or other applications by referencing those libraries inside an application. PHP has a long list of APIs and functions that expand its capability beyond that of any other contemporary Web scripting language.

PHP has enjoyed a long-lived association with databases, especially MySQL. However, PHP plays equally well with Oracle, DB2, SQLite, PostgreSQL, Sybase and Microsoft's SQL Server. Migrating from one database server to another is usually quite simple since most of PHP's functions have a common naming convention. A programmer can do simple global pattern replacements to change from one database brand to another. The following is an example of some often used MySQL functions and their Microsoft SQL Server equivalents.

MySQL MS SQL
mysql_connectmssql_connect
mysql_querymssql_query
mysql_fetch_array mssql_fetch_array

As you can see in the table, an application that accesses a MySQL database can be redesigned as a Microsoft SQL Server application with minimal effort.

PHP is available for almost every current operating system. This makes the code portable to other platforms with few, if any, changes. If you run a PHP website on Windows with IIS and it crashes, you can use the PHP scripts and pages on a PHP-enabled Linux server with minor modifications. You have to change any absolute paths and some parameters only in the PHP configuration file. For similar systems (Unix to Linux), you may only have to copy the files to the new server and restart your Web server.

PHP enjoys such widespread popularity because:

  • It is easy to learn: Its C-like syntax makes it an easy language to learn for programmers and nonprogrammers alike.
  • It blends well with HTML: You can mix PHP scripts right inside your HTML or place HTML tags and code inside PHP files.
  • PHP has a vast library of functions and APIs: PHP's ability to interact with LDAP, databases and the file system makes it a great "one stop shop" for developers.
  • You can rapidly create Web applications and database-backed applications: PHP is so often used with databases, especially open-source databases, that several books are available on the shared topic of PHP and MySQL.
  • It is cross-platform capable: PHP is used on Windows, Linux, commercial flavors of Unix and MacOS X.

When should you use PHP?

  • Creating an intranet site.
  • Prototyping an application that will be converted to Java or some other language.
  • Creating a Web database application.
  • Deploying an inexpensive or quick solution.
  • Using ready-made apps from Sourceforge.net or other sites.
 
 
Loading...
 
WHITE PAPERS

Top 10 Business Drivers

The restructuring of Wall Street that took place in 2008 will have a major impact on the investment management business in 2009.
 

How is open source changing the face of enterprise software?

Learn how open source and business intelligence ignite enterprises to reach new levels of performance excellence.
 

Red Hat Open Source Security

The rapid innovation and collaboration of open source development helps Red Hat provide industry-leading security tools and processes.
 

Now is the Time for Open Source

In today's economy, we are all trying to do more with less. Another modern business necessity is flexible, mobile data and systems-complex IT.
 

Bridging the IT Visibility Gap in Complex Composite Applications

Composite Application Management
 

Enhance the Performance of your Data Center

Enhancing performance through Virtualization realizes operational efficiencies and offers reliability.
 

WEBCASTS

IT Consolidation Made Easy

The Primary IT Initiative for Reducing Costs
 

CIOs Weigh In On Virtualization

Date: November 19, 2009 Time: 2:00 PM EST

Gary Beach, publisher emeritus of CIO magazine,...
 

Webcast- Vantage 11: Redefining Application Performance Management

Redefining Application Performance Management
 

Architecting Business Intelligence Applications for Change: The Open Solution

Architecting BI Applications for Change
 

Taking a Seat at the Executive Table: The Reality of Virtualization

This year, for the first time, the number of virtual machines is on track to exceed the number of physical machines...
 

Who Are the Data Center Leaders?

Today's data center is still very much a heterogeneous environment. Gabriel Consulting recently surveyed over 250 d...
 

Resource Alerts

Get instant email notifications by topic when white papers, webcasts, and case studies are added to our library.

 
FEATURED SPONSORS
 
 
 
SPONSORED LINKS
 

Disciplined Autonomy: Resolving the Tension Between Flexibility and Control

Enterprise Capture: Your Onramp to Business Process Automation

Seven Technologies for Advanced Mail Protection

Server Consolidation: Leveraging the Benefits of Virtualization

Join us at the US-Brazil IT-BPO Summit, on November 10th in New York.

Unified Communications: Thoughts, Strategies and Predictions. Join the discussion

Read the RSA report: Security for Business Innovation

Webcast: Looking to the Cloud for Email and Collaboration Services

64-page prescriptive guide to security, compliance, and IT operations.

Keep your IT expertise up to date. Join the Intel Premier IT Professionals.

A new fleet of PCs with a total ROI in 10 months. Find your ROI.

eZine: A Roadmap to Reducing IT Complexity

Reduce risk, gain agility. See how Progress can help your business.

Virtualization Technology as a Business Solution

eZine: A Roadmap to Reducing IT Complexity

World-class trading technology solutions from NYSE Technologies.

If You're Paying for Telecom, You're Paying Too Much. Contact Asentinel Today.

Trade-In your old printer and save up to $1,000 plus free recycling!

infoBOOM! - The Mid-Sized Company CIO's Exclusive Community

Live Webinar: Applying Business Analytics. Click here to learn more

White Paper: 4 Customer Service Myths

Mobile Security: The Essential Ingredient for Today's Enterprise

White Paper: Improve Agility with Operational Responsiveness

White Paper: 5 Best Practices for Smartphone Support

Global Research: CIOs Weigh In On Virtualization

Tolly Group Lab Test Results: Cisco vs. ShoreTel

SETLabs: The Impact of Performance Engineering

Top to Bottom Performance Management Excellence at the City of Chicago

See how AT&T can help protect your network.

Top Five CIO Challenges

Streamline IT Costs. Boost Performance with WAN Optimization.

Want to know how you can maximize employee productivity?

Build your 1st app FREE with Force.com

TDWI checklist helps define data readiness for analytics. Download report.

Increase UPS efficiency without sacrificing protection.

A Clear View Toward Virtualization

Virtualization Technology as a Business Solution

The rules of infrastructure management just changed.

A Clear View Toward Virtualization

Interactive Q&A helps you discover key ways to maximize IT assets.

Ready to virtualize tier one applications? Check your virtualization maturity.

Think you can't afford a Cisco Switch? Cisco Catalyst Switches are now more affordable.

Five minute business analytics assessment. Immediate results.

The Case for Investing in Business Analytics Technology. Read white paper.

White Paper: Right-Sizing Your Power Infrastructure

Webcast: Unleashing the Power of Customer Data

White Paper: Managed Security for a Not-So-Secure World

SharePoint - Unchecked growth of content is unsustainable.

White Paper: Legacy Tools: Not Built for the Helpdesk

Taking a Seat at the Executive Table: The Reality of Virtualization