Miscellaneous
  Home arrow Miscellaneous arrow Page 2 - Controlling PHP
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Controlling PHP
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2004-06-15

    Table of Contents:
  • Controlling PHP
  • php.ini
  • httpd.conf
  • Window's Registry
  • PHP Scripts
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Controlling PHP - php.ini


    (Page 2 of 6 )

    One way in which the behavior of PHP can be modified is through it's main configuration file, php.ini. While PHP will happily run without it, it's a good to be use this file to fine tune your PHP installation.

    PHP first looks in the current working directory for php.ini. If it's not found in the current directory, PHP then looks to the default path for the configuration file. The default path is /usr/local/lib but can be changed at compile time using the --with-config-file-path option.

    If PHP runs as an Apache module, because it's loaded when Apache starts and remains in memory then php.ini will only be parsed once. Configuration changes require Apache to be restarted.

    In contrast, if PHP runs as a standalone interpreter for CGI scripts then php.ini is parsed each time the PHP processor is loaded (each time a script is called). No other services need to be reloaded for the changes to take effect.

    The php.ini file is not installed by default. Instead, there are two copies in the source directory that may be copied and renamed: php.ini-recommended and php.ini-dist. The first one is geared more towards controlling PHP's behavior to provide a development environment while the later is sets options suitable for a production environment.

    php.ini uses the semicolon to denote comments. Any line beginning with a semicolon, or any text following a semicolon up until the end of the line will be ignored when the file is parsed.

    Various configuration options that are related to one another are grouped and labeled with section markers. These section markers appear in square braces and are also ignored.

    Here is a simplified excerpt from the php.ini-recommended file:

    [PHP]
    ; Enable the PHP scripting language engine under Apache
    engine = On

    ; Allow ASP-style <% %> tags
    asp_tags = Off

    ; The number of significant digits displayed in floating
    ; point numbers
    precision = 14

    The PHP section marker shows that the following directives are global options that affect the overall operation of PHP (as opposed to more specialized options which affect specific modules and extensions).

    Informational comments explain the various options. They're there just for the sake of convenience and are ignored by PHP when it parses the configuration file.

    The actual configuration option consists of two parts: the directive and it's value. Some directives are boolean in nature and can either be set to on or off. Others can be set to string or integer values.

    More Miscellaneous Articles
    More By bluephoenix


       · Dear SirExplained the Mantra of Controlling PHP Behaviour in different...
       · I'm glad you've found it beneficial! Personally, I think I'll be installing...
       · lkj
     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek