During installation you modified the php.ini file to affect the way PHP runs and what features it includes. Appendix F, "Configuring PHP5," at the end of the book discusses the major settings in the php.ini file, as well as some of the extensions currently available for PHP, but in this section we'll go over a few of the most important PHP configurations settings and extensions.
The php.ini file is parsed when PHP is first loaded and executed, so that PHP behaves (for any script running on that Web server) in a particular way. All lines that are not preceded by a semicolon are working commands; think of everything else in the file as a comment. Following is the text of several sections of the php.ini-recommended file. The settings shown are important because they have a direct effect on how PHP behaves (under common operating circumstances), will affect your code, or may affect the security of your applications:
;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; 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 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 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"); ?>
|copyright © dedserveronline.com|