Datasheet
P1: KTX
WY027-01 WY027-Mercer WY027-v2.cls June 5, 2004 0:44
Getting Up and Running
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing
request data
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off
There’s much more information regarding the settings in php.ini in Appendix F.
PHP Extensions
PHP extensions are programmatic capabilities that add to or enhance PHP’s built-in capabilities for
performing useful work in your PHP programs. Although no special extensions are used in the early
chapters of this book, you’ll run across some later. Meanwhile, Appendix F covers all of the available
extensions.
Caching
Caching is a method by which some results are stored temporarily, so that all processing does not have to
be repeated each time a new request is made to the server. One potential disadvantage of running all your
code on the server is that if the client (or some machine in between the end user and your site) has a cache
going, the user may not get the most recently processed page To work around caching (at least for most
browsers and servers), you can place the following code in your programs:
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");
?>
The first line works well with HTTP 1.1, the second line with HTTP 1.0, and the third works by specifying
a date in the past (more about HTTP in Chapter 2).
Summary
This chapter covered a bit of the history of PHP and several ways to install PHP alongside common Web
server software.
You learned how to install PHP on both Windows and Linux platforms, some of the differences about
installing PHP as a CGI or as a separate module, the basic meaning of some PHP settings, where PHP
29