Section 2.4. System Configuration


2.4. System Configuration

Now that you have PHP and your web server up and running, you will probably want to configure PHP to your liking. All of PHP's settings are available in its php.ini file, which, if you followed these installation instructions, is available either in /usr/local/lib/php (Unix) or c:\windows\php.ini (Windows). Open this in your text editor of choice (you will need to be root on Unix).

A list of popular options, what they do, and their default values (if you use php.ini-recommended as the default) is given in Table 2-2. Note that lines starting with a semicolon (;) are comments, and are ignored by PHP.

Table 2-2. Configuration options for PHP

Option

Meaning

Default

assert.active

Enables the assert( ) function

On

display_errors

Sets whether PHP should output error messages to the screen

Off

error_reporting

Decides what types of errors PHP should notify you of

E_ALL

expose_php

Allows PHP to identify itself to clients through the web server

On

extension

Loads a PHP extension

N/A

extension_dir

Sets the directory where PHP should look for extensions

./

file_uploads

Decides whether PHP should accept users uploading files

On

log_errors

Determines whether PHP should store error messages in a log file

On

magic_quotes_gpc

Determines whether PHP should automatically run form data through addslashes( ) before you get it

Off

max_execution_time

Determines how long a script may run for before timing out

30 seconds

mbstring.func_overload

Converts non-multibyte string functions to their multibyte equivalents

0

memory_limit

Sets the maximum amount of RAM a PHP script may consume

8M

precision

Determines number of decimal places for floating-point numbers

14

register_globals

Decides whether all superglobal arrays should have their elements exported to the global scope

Off

safe_mode

Enables high security mode for shared server environments

Off

session.save_path

Selects the directory in which session data will be stored

/tmp

short_open_tags

Enables <? for opening PHP code blocks

On

SMTP

Sets the mail server address for the mail( ) function.

 

variables_order

Determines the order in which variables are parsed: G is GET, P is POST, C is cookie, and S is session

GPCS


If you intend to use sessions, make sure you set the sessiondir variable to a directory that a) exists, and b) Apache has read and write access to.




PHP in a Nutshell
Ubuntu Unleashed
ISBN: 596100671
EAN: 2147483647
Year: 2003
Pages: 249

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net