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 »
June 17, 11:30 AM - 12:30 PM U.S./ET (GMT-4)
Larry Bonfante, CIO of the U.S. Tennis Association, will discuss the skills and approaches that your rising IT leaders must learn to be effective in an executive capacity.
How to Handle Your New CEO: Managing Turnover at the Top
June 18, 11:00 AM - 12:00 PM U.S./Eastern (GMT-4)
Turbulent times have increased turnover at the top. Find out what Council CIOs have done to "break in" new CEOs—build relationships, set expectations, educate on the role of IT.
Mid-Market CIO Panel: Tips and Techniques for Improving Vendor Relationships
July 15, 4:00 PM - 5:00 PM U.S./Eastern (GMT-4)
We'll highlight relationship priorities and best practices identified in a Council study, and we'll interact with a CIO panel on the approaches they've used to improve strategic vendor partnerships.
Executive Competencies Assessment Tool
Assess Your Business Leadership Skills with the Council's new benchmarking tool. Rate yourself in change leadership, strategy, customer focus and more.
Learn more about the CIO Executive Council »Apply today for a FREE subscription to CIO Magazine!
January 25, 2008 — CIO —
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.
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_connect | mssql_connect |
| mysql_query | mssql_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:
When should you use PHP?