Chapter 29. Learning PHP Configuration

In this chapter, we discuss the many configuration options available with PHP, particularly the Unix Apache module version, in some detail. The goal is for you to better understand the tradeoffs of each capability you may enable or disable and the capabilities that may affect each other. We also touch on ways you can measure and improve the performance of your PHP scripts.

Viewing Environment Variables

To see any of the settings discussed in the following section, you have only to use the phpinfo() function in a valid PHP script. This function begins with a quick recap of the PHP version, your platform, date of build, and compile-time options; it then moves methodically through your PHP settings. You will also see some information about your web server settings and environment variables.

The output of the phpinfo() function is a potential bonanza for crackers, so you shouldn't leave it sitting around on a production server. With the release of 5.2.1, phpinfo() includes a META tag for robots that causes a web spider honoring the robots protocol not to index a phpinfo() file. Nevertheless, because there's nothing that requires adherence to the robots protocol, this should not be relied on as a security measure.

Understanding PHP Configuration

Like most of the best open source software packages, PHP is highly configurable. It's left up to you, the individual ...

Get PHP6 and MySQL® 6 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.