This list of recommended reading material on PHP is compiled from a variety of online sources by Web application developers in IBM's Global Production Services organization. These resources have been selected with the intention of introducing IT specialists and architects to PHP, providing specific information about development and maintenance, and helping to integrate the technology with IBM products.
PHP is an interpreted programming language run in an environment provided by an open source core engine and extensions whose development is driven by many companies and individuals. As such, this list describes resources that apply to writing PHP programs and to customizing the interpreter's environment. It links to material published by IBM and content provided by others.
This list is updated periodically. Please help us improve it by providing your comments below.
- Getting started
- Community and news
- Other resources
PHP is a scripting language most often embedded in HTML documents and executed on the server before output is sent to the Web browser. It can also be used as a command-line tool outside of the Web server environment.
PHP is commonly installed in conjunction with other open source software to build Web applications, a platform referred to by the term "LAMP" (which stands for Linux, Apache, MySQL, and PHP), though other components can be used. For example, AIX® in place of Linux®, or DB2® instead of MySQL.
- PHP definition
- Wikipedia provides an overview of PHP with code samples demonstrating fundamental programming concepts.
- Official PHP documentation
- The PHP manual is the primary source for information about PHP. It contains a frequently asked questions (FAQ) list, installation guides, language reference, and comprehensive function documentation with user-contributed comments.
2. Getting started
2a. Development environment
You can't write PHP without a tool of some sort, be it a simple text editor or full-blown integrated development environment (IDE). Since there are dozens to choose from, here are starting points for a few of the most popular.
- Zend Studio
- Zend Studio is a commercial IDE from the company that architected the PHP engine. This editor provides syntax highlighting with code assist and supports debugging, source control, documentation, and database connections from within the tool itself.
- jEdit is a free software text editor written in the Java™ programming language, so it runs in multiple platforms and is extensible via plug-ins. jEdit supports PHP syntax highlighting and additional features, such as syntax validation and code navigation, available through the PHP plug-in PHPParse.
When creating or deploying PHP applications, an appropriate environment must be available to run them.
- Zend Core for IBM
- Zend Core for IBM is a seamless out-of-the-box, easy-to-install, and supported PHP development and production environment. The developerWorks article "Zend Core for IBM - A guided tour for PHP developers" provides guidance in installation and use, and will help get you up and running quickly. The Zend Core for IBM FAQ, Zend Developer Zone for IBM, and Zend Core for IBM marketing document provide additional background information.
- Install XAMPP for easy, integrated development
- Open source stacks such as XAMPP from Apache Friends are simplifying open source development by making it easier to write and distribute applications in a stable, standardized environment. Learn how to install, configure, and back up XAMPP on Mandrake Linux V10.0, learn how to configure and administer XAMPP, and learn how to install your own applications in an XAMPP environment.
2c. Source control
Whether you're collaborating with a team or need to preserve versions of your own files, source control is the answer.
- Tools for Writing Better PHP Code -- Version Control with Subversion
- Jeff Knight and Andrew Yochum demonstrate how Subversion can be used to manage multiple projects and developers, as well as development and production environments
- "Create a blog from scratch with PHP and Subversion"
- PHP is a great Web programming language to use when creating dynamic Web sites, such as blogs. This tutorial explains how to build a blog from scratch, while storing data using flat files. The Web site will be backed up on a remote system using Subversion, protecting data in the event of a Web-site crash. Subversion is growing in popularity, and it is a great candidate to back up the site. With Subversion, it's also possible to roll back the Web site to earlier versions of the blog if your server crashes, or if you just didn't like last week's rambling
3a. Learning PHP
With a development environment in place, you can learn about PHP's core functionality and begin writing code.
- Absolute beginners
- Zend maintains a collection of PHP 101 introductory tutorials for those who are new to PHP.
- "Introduction to LAMP technology"
- This tutorial explores the LAMP Web development framework and shows how that framework can help you build applications to solve common business problems. The tutorial begins with an exploration of the LAMP architecture, then introduces fundamental PHP concepts. After a solid grounding of PHP, the tutorial explains MySQL support, with coverage focusing on database concepts and how to access MySQL from PHP. All of these techniques are discussed within the context of a real-world customer management example.
- "Getting started with objects with PHP V5"
- This article describes the fundamentals of objects and classes in PHP V5, from the very basics through to inheritance, for experienced object-oriented programmers and those who have not yet been introduced to objects.
- "Learning PHP, Part 1"
- This tutorial is Part 1 of a three-part series that takes you from the most basic PHP script to working with databases and streaming from the file system by documenting the building of a document workflow system. Look at the basics of building a PHP script, including syntax, HTML forms, and database connections.
- "Learning PHP, Part 2"
- This tutorial is Part 2 of a three-part series that takes you from the most basic PHP script to working with databases and streaming from the file system by documenting the building of a document workflow system. Here, documents are uploaded by users and stored in a non-Web-accessible location for retrieval by the application in Part 3. Also look at working with XML files using DOM and SAX, and at exceptions.
- "Learning PHP, Part 3"
- This tutorial concludes a three-part series that takes you from the most basic PHP script to working with databases and streaming from the file system by documenting the building of a document workflow system. Learn about using HTTP authentication, streaming files, and how to create objects and exceptions.
3b. Advanced PHP
Once you've gotten your feet wet with PHP, you might choose to enhance, refactor, or extend your application.
- "Advanced PHP V5 objects"
- The May 2005 IBM developerWorks article "Getting started with objects with PHP V5" covered enough detail to get a reader up and running with the basics of classes and objects in PHP. This article introduces some of PHP V5's more advanced and design-oriented features. Among them are object types, which allow for decoupling the components of a system from one another, creating reusable, extensible, and scalable code.
- Introduction to PHP Image Functions
- PHP is not limited to creating just HTML output. It can also be used to create and manipulate image files in a variety of image formats, including GIF, PNG, JPG, WBMP, and XPM. Jeff Knight talks about using the GD library and the bundled version in PHP. He covers installation and configuration, a discussion of the image functions themselves, and related topics like patent laws and basic color models and theory.
- "Create graphics the smart way with PHP"
- Learn to build an object-oriented graphics layer in PHP. Using object-oriented systems can make building complex graphics much easier than building the graphics using the primitives in the standard PHP library.
- "How to use regular expressions in PHP"
- Regular expressions can provide a powerful way to work with text. Using regular expressions, you can do complex validation of user input, parse user input and file contents, and reformat strings. PHP provides simple methods that let you use POSIX and PCRE regular expressions. Discover the differences between POSIX and PCRE, and how you can use regular expressions and PHP V5.
- "Reading and writing the XML DOM with PHP"
- Myriad techniques are available for reading and writing XML in PHP. This article presents three methods for reading XML: using the DOM library, using the SAX parser, and using regular expressions. Writing XML using DOM and PHP text templating is also covered.
- "Using AJAX with PHP and Sajax"
3c. Debugging and profiling
Find and fix application problems.
- "Debugging techniques for PHP programmers"
- Explore various methods for debugging PHP applications, including turning on error reporting in Apache and PHP, and placing strategic print statements to locate the source of more difficult bugs through a simple example PHP script. The PHPEclipse plug-in for Eclipse, a slick development environment with real-time syntax parsing abilities, is also covered, as is the DBG debugger extension for PHPEclipse.
- "PHP Performance Profiling"
- Learn how to use the Advanced PHP Debugger (APD) to profile your PHP code. Code profiling helps you identify bottlenecks or inefficient code in your application, enabling you to tune the code where needed.
- Advanced PHP Debugger
- The Advanced PHP Debugger (APD) is a Zend extension that provides traces suitable for debugging and profiling code, as well as full stack backtrace. Events-based logging is also supported, so different levels of information logging can be set on a script by script basis.
- Xdebug is an extension that offers debugging information, including full traces and function/line indicators. Xdebug also includes profiling and script execution analysis.
4a. IBM database servers
Traditionally, developers have connected to IBM database servers through the Unified ODBC functions in PHP. IBM now recommends using the new PECL ibm_db2 extension for PHP V4 and PHP V5, or PDO for PHP V5 when building new applications. You can decide which extensions are available when compiling PHP, or use Zend Core for IBM to provide you with preconfigured options.
- Developing PHP Applications for IBM Data Servers
- This Redbook describes the installation and configuration details for setting up the IBM data servers and Apache Web application server for PHP applications. Including Zend Core for IBM, Zend Studio installation and configuration, it discusses the process of porting PHP applications from MySQL V5 to DB2 UDB V8.2.
- "Built for the Web"
- IBM's new partnership with Zend Technologies makes PHP Web development even easier. This article provides an overview of PHP development for IBM database servers and discusses the challenges and solutions at a high level.
- IBM DB2 Universal Database, Cloudscape, and Apache Derby
- This presentation provides an excellent technical overview of the APIs available for connecting to IBM database servers from PHP.
- "Application development with DB2 UDB"
- When it comes to application developers, no other database provides the level of tooling and language integration like IBM DB2 Universal Database (DB2 UDB). If you're exploring the world of Web services vis-a-vis a services-oriented architecture (SOA), the DB2 UDB database platform is there for you, whether you chose to write your applications in PHP, the Java language, or .NET. See for yourself just how easy it is to develop applications for the DB2 platform.
- "Develop IBM Cloudscape and DB2 Universal Database applications with PHP"
- Learn to configure IBM Cloudscape V10.0 and DB2 UDB V8.2 servers for access from PHP V4.x and PHP V5.x. Write database applications using the Unified ODBC extension. Overcome common performance issues due to scrollable cursors and avoid functional limitations in stored procedures.
- "DB2 Universal Database and the PHP Developer? Absolutely!"
- Paul C. Zikopoulos introduces the PHP DB2 APIs and demonstrates the new database connection functionality in Zend Studio provided by the Zend Core for IBM add-in.
- "Connect PHP to DB2 and Cloudscape via PDO"
- PHP V5.1 is set to ship with a new database connectivity layer known as PHP Data Objects (PDO). While PHP has always had good database connectivity, PDO takes PHP to the next level.
- "Zend Core for IBM technical roadmap"
- The Zend Core for IBM provides a seamless out-of-the-box PHP development and production environment, supported by Zend and integrated with IBM's Cloudscape and DB2 UDB database programs. The product includes native support for XML and Web services in support of increased adoption of SOA. It delivers a rapid development and deployment foundation for database-driven applications and offers an upgrade path from the easy-to-use, lightweight Cloudscape database, to the mission-critical DB2, by providing a consistent API between the two.
- "Zend Core for IBM -- A guided tour for PHP developers"
- Have you considered setting up PHP V5 on your Linux server, but not had the time to learn how? This article will help guide you through the installation of a PHP V5 environment using the industry's first integrated PHP environment that includes the IBM Cloudscape database server. Installation and configuration is greatly simplified using Zend Core for IBM compared to setting up a complete development and deployment environment from scratch. Zend Core for IBM also provides commonly used PHP extensions and DB2 client libraries to get you connected to your DB2 UDB servers. Support for Zend Core is available from Zend Technologies, a leading provider of PHP products and services, but it is a free download and a time-saver for any PHP developer who wants to build Web applications for IBM Cloudscape or DB2 UDB.
- "DB2 Express-C, the developer-friendly alternative"
- There are many no-charge Relational Database Management System (RDBMS) options available. Some are open source, and some are available from commercial vendors at no charge. If you are developing applications using C/C++, Java technology, .NET, or PHP and are looking for a proven data server with innovative technology and a growing developer community base deployed in many critical business solutions, it's time to take a look at DB2 Express-C. Find out how to get started quickly using DB2 Express-C for all of your applications, and review an automation and tuning scenario to optimize your application.
4b. IBM Web and application servers
PHP can also be integrated with other IBM software products.
- "Hosting PHP applications on the IBM HTTP Server"
- IBM maintains its own copy of the Apache Web server and ships it as the IBM HTTP Server, along with its WebSphere® Application Server. This Web server is fundamentally Apache, and as such, can host and run applications written in PHP. Learn the differences between the open source Apache Web server and IBM's version, and view demonstrations of IBM's version running a well-known PHP application.
- "Pair J2EE with PHP to implement a common Web application infrastructure"
- Conventional thinking often pits the AMP stack of open source technologies -- made up of Apache, MySQL, and PHP -- against Enterprise Java applications and IBM middleware. Sure, each camp has something to fit in the Web server role, each has something for the business layer, and each has something else for the data tier. But can't we all just get along? Of course we can, says Daniel Krook, who shows how and when it can be beneficial to mix and match these once-considered-mutually-exclusive solutions to exploit their relative advantages and develop new and innovative applications.
- "Run PHP applications in Apache Geronimo"
- PHP has been a popular scripting language for some time. However, with the growing buzz over Java technology and Apache Geronimo, a J2EE-certified application server, many experienced developers shy away from using PHP with Geronimo because only JavaServer Page (JSP) technology is supported out of the box. The PHP Java Bridge solves this problem by providing full support for PHP on Geronimo and for sharing sessions across PHP and JSP scripts.
4c. Third-party services
PHP can tie into many third-party services to support complex e-commerce applications.
- "Develop apps with Web services and the eBay SDK, Part 1"
- The face of eBay that most people are familiar with is the company's Web presence. Learn how to write a small application that allows users to execute ad-hoc queries against eBay through eBay's SOAP API. The application uses the eBay Java SDK. The use case is targeted at a small subset of the API, but you can generally apply the principles.
- "Develop apps with Web services and the eBay SDK, Part 2"
- Demonstrate good system integration practices. Learn how to develop a Java application using the eBay SOAP SDK. Part 2 of this series focuses on integrating the application with eBay's Web services, using the authentication and authorization system, and making API calls.
- "Develop apps with Web services and the eBay SDK, Part 3"
- Create applications in PHP V5 that interact with eBay through Web services. Almost half of eBay's transactions occur through its Web services platform. Acquire a solid understanding of the mechanics of the eBay XML API and learn how to use the Services_Ebay PHP extension.
- "Create a Web storefront using PHP and PayPal, Part 1"
- This series chronicles the building of a Web storefront in PHP using PHP Data Objects to access a Derby database. The storefront includes a user-manageable shopping cart that allows item purchases using PayPal and includes the ability for merchants to notify customers via e-mail on successful orders automatically.
- "Create a Web storefront using PHP and PayPal, Part 2"
- This series chronicles the building of a Web storefront in PHP using PHP Data Objects to access a Derby database. The storefront includes a user-manageable shopping cart that allows item purchases using PayPal and includes the ability for merchants to notify customers via e-mail on successful orders automatically. Part 2 covers creating shopping carts and making payments via PayPal.
- "Create a Web storefront using PHP and PayPal, Part 3"
- This series chronicles the building of a Web storefront in PHP using PHP Data Objects to access a Derby database. The storefront includes a user-manageable shopping cart that allows item purchases using PayPal and includes the ability for merchants to notify customers via e-mail on successful orders automatically. This final part covers the addition of transactions, a shipping component, and an e-mail notification feature.
- "Create an Amazon storefront using PHP, Part 1"
- This is the first of a two-part tutorial that constructs an Amazon storefront using PHP and the Amazon E-Commerce Service (ECS). The storefront allows shoppers to view items displayed in lists or search for specific items in the store.
- "Create an Amazon storefront using PHP, Part 2"
- This is Part 2 of a two-part tutorial that constructs an Amazon storefront using PHP and the Amazon E-Commerce Service (ECS). Find out how to create a shopping cart, a "browse for similar items" feature, a specialty theme shop, and a collectibles shop.
PHP ships with many built-in capabilities, but it can also be easily extended. You can take advantage of pre-written PHP components (PEAR), compile existing packaged C extensions (PECL), or write your own.
- PEAR and PECL InfoCenter
- Find out how to work with libraries written in PHP or extensions written in C.
- "An introduction to Service Data Objects for PHP"
- A team of IBM developers who implemented SDO in PHP rdescribe a real-world example of adding new capability to PHP via a PECL extension. The extension is available for download at the PECL SDO.
6a. Between PHP versions
PHP V5 provides many new features and is largely backward-compatible with PHP V4. However, there are important differences that may affect how your application behaves.
- Zend Developer Zone for PHP5
- This Zend page highlights developments and additions to PHP V5.
- Migrating from PHP 4 to PHP 5
- Get answers to frequently asked questions about migration.
- "Why PHP 5 Rocks!"
- Learn about upgrading to PHP V5. The overview provided is explored in detail in the author's book.
6b. To IBM database servers
IBM databases offer many features not available in other vendor products.
- IBM Redbook: MySQL to DB2 UDB Conversion Guide
- DB2 UDB has long been known for its technology leadership. This IBM Redbook is an informative guide that describes how to migrate the database system from MySQL to DB2 UDB V8.1 on Linux and how to convert applications to use DB2 UDB instead of MySQL.
PHP enables you to build functional applications quickly. This can lead to inadequate error handling and input verification. Consider these common pitfalls before deploying your site.
- "Auditing PHP, Part 1"
- Chances are that at some point, you've had a concern about the security of a PHP application. When faced with an auditing task, do you know what to look for? This series walks you through PHP and helps you understand it enough to know what to look for when conducting a security audit. Part 1 walks you through understanding the register_globals setting.
- PHP Security Consortium
- The PHP Security Consortium (PHPSC) is a group of PHP experts who promote best practices for secure PHP development. The PHPSC site contains articles, a PHP security guide, and weekly summaries of PHP security issues.
- Top 7 PHP Security Blunders
- Pax Dickinson addresses seven common security issues and how to mitigate the risk in your code.
8. Community and news
8a. Mailing lists
Mailing lists are an excellent resource for getting answers to your PHP installation and development problems. See if there is already an answer in the archives. If not, ask your question. Many user groups have their own mailing lists.
- Mailing lists at PHP.net
- There are many lists for those interested in PHP. This site includes lists for general and subject-specific topics in PHP development for end users, as well as a few lists for those building the PHP engine itself.
PHP gets better every day. Keeping up with what has changed is important.
- PHP Weekly Summary
- Read Zend's weekly summaries of new code, bugs, fixes, patches and talk
- SecurityFocus Summaries
- Keep on top of weekly updates that may affect the security of your PHP applications.
Peruse this partial list of blogs by core PHP engine developers and PHP application developers. Following trends here will give you a good idea of what to expect in upcoming versions of PHP, as well as what development best practices to keep on top of.
- Ilia Alshanetsky
- Ilia Alshanetsky is a PHP speaker, and book and article author.
- Andi Gutmans
- Andi Gutmans is an architect of the Zend Engine and co-founder of Zend Technologies.
- John Lim
- John Lim is a PHP developer.
- Mike Lively
- Mike Lively is a PHP developer.
- Visit the official blog of PHPDeveloper.org.
- Professional PHP Blog
- See this blog for PHP programming, Web development, PHP advocacy and best practices.
- Derick Rethans
- Derick Rethans is a developer of PHP's mcrypt, date and input-filter extensions, bug fixes, additions among other contributions.
- Tobias Schlitt
- Tobias Schlitt is a PHP developer.
- Dan Scott
- Dan Scott is the release lead for the ibm_db2 and PDO_INFORMIX extensions, among other contributions to PHP.
- Chris Shiflett
- Chris Shiflett is a PHP consultant, speaker, and book and article author.
- SitePoint is a PHP and Web design information site.
- David Sklar
- David Sklar is a frequent author and speaker on PHP.
- Zeev Suraski
- Zeev Suraski is an architect of the Zend Engine and co-founder of Zend Technologies.
- Jason Sweat
- Jason Sweat is a PHP speaker and book author.
- Adam Trachtenberg
- Adam Trachtenberg is a PHP speaker, and book and article author.
- Andrei Zmievski
- Andrei Zmievski, Technical Yahoo at Yahoo!, is a principal developer of PHP.
9. Other resources
9a. User groups
User groups are one of the best ways to meet fellow developers in person and regularly hear about current topics from experts.
- New York PHP
- New York PHP meets at the IBM building in midtown Manhattan on the fourth Tuesday of every month.
- PHP.net calendar
- The calendar at php.net lists user group meetings for each month.
Many speakers at open source or PHP-specific conferences provide their slides online.
- Ilia Alshanetsky
- See Ilia Alshanetsky's "PHP and Peformance" and other presentations.
- Marcus Börger
- See Marcus Börger's "PHP Code Camp" and other presentations.
- Derick Rethans
- See Derick Rethans' "RAD for PHP" and other presentations.
- Chris Shiflett
- See Chris Shiflett's "PHP Security Briefing" and other presentations.
- Talks at php.net
- This includes a listing of talks using a PHP presentation system.
There are many books published about PHP. These are some of the ones we find helpful.
- Advanced PHP Programming
- George Schlossnagle
- Apache Derby -- Off to the Races: Includes Details of IBM Cloudscape
- Paul C. Zikopoulos, George Baklarz, Dan Scott
- Essential PHP Security
- Chris Shiflett
- Learning PHP 5
- David Sklar
- PHP and MySQL Web Development
- Luke Welling and Laura Thomson
- PHP 5 Objects, Patterns, and Practice
- Matt Zandstra
- Pro PHP Security
- Chris Snyder and Michael Southwell
- Upgrading to PHP 5
- Adam Trachtenberg
Peruse this high-level coverage of PHP related topics.
- Building Dynamic Data-Driven Web Applications with PHP and DB2 UDB and Cloudscape
- PHP, the open source Web development language, is the fastest way to build business-critical, scalable Web applications that tie in with XML and Web services.
These are available at newstands or online in PDF format.
Dig deeper into Open source on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.