11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

www.it-ebooks.infoCHAPTER 2 • CONFIGURING YOUR ENVIRONMENT• php_admin_flag: Sets the value of the specified directive. This differs fromphp_value in that it cannot be used within an .htaccess file and cannot beoverridden within virtual hosts or .htaccess.For example, to disable the short tags directive and prevent others from overriding it, add thefollowing line to your httpd.conf file:php_admin_flag short_open_tag OffWithin the Executing ScriptThe third, and most localized, means for manipulating <strong>PHP</strong>’s configuration variables is via the ini_set()function. For example, suppose you want to modify <strong>PHP</strong>’s maximum execution time for a given script.Just embed the following command into the top of the script:ini_set('max_execution_time', '60');Configuration Directive ScopeCan configuration directives be modified anywhere? The answer is no, for a variety of reasons, most ofthem security related. Each directive is assigned a scope, and the directive can be modified only withinthat scope. In total, there are four scopes:• <strong>PHP</strong>_INI_PERDIR: Directive can be modified within the php.ini, httpd.conf, or.htaccess files• <strong>PHP</strong>_INI_SYSTEM: Directive can be modified within the php.ini and httpd.conf files• <strong>PHP</strong>_INI_USER: Directive can be modified within user scripts• <strong>PHP</strong>_INI_ALL: Directive can be modified anywhere<strong>PHP</strong>’s Configuration DirectivesThe following sections introduce many of <strong>PHP</strong>’s core configuration directives. In addition to a generaldefinition, each section includes the configuration directive’s scope and default value. Because you’llprobably spend the majority of your time working with these variables from within the php.ini file, thedirectives are introduced as they appear in this file.Note that the directives introduced in this section are largely relevant solely to <strong>PHP</strong>’s generalbehavior; directives pertinent to extensions or to topics in which considerable attention is given later inthe book are not introduced in this section but rather are introduced in the appropriate chapter.Language OptionsThe directives located in this section determine some of the language’s most basic behavior. You’lldefinitely want to take a few moments to become acquainted with these configuration possibilities. Notethat I am only highlighting some of the most commonly used directives. Please take some time to peruseyour php.ini file for an overview of what other directives are at your disposal.21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!