PHP-manual | ||
---|---|---|
Föregående | Kapitel 4. Konfiguration | Nästa |
Tabell 4-3. Language and Misc Configuration Options
Name | Default | Changeable |
---|---|---|
short_open_tag | On | PHP_INI_SYSTEM|PHP_INI_PERDIR |
asp_tags | Off | PHP_INI_SYSTEM|PHP_INI_PERDIR |
precision | "14" | PHP_INI_ALL |
y2k_compliance | Off | PHP_INI_ALL |
allow_call_time_pass_reference | On | PHP_INI_SYSTEM|PHP_INI_PERDIR |
expose_php | On | PHP_INI_SYSTEM |
Here is a short explanation of the configuration directives.
Tells whether the short form (<? ?>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use <?xml ?> inline. Otherwise, you can print it with PHP, for example: <?php echo '<?xml version="1.0"'; ?>. Also if disabled, you must use the long form of the PHP open tag (<?php ?>).
Not: This directive also affects the shorthand <?=, which is identical to <? echo. Use of this shortcut requires short_open_tag to be on.
Ger dig möjligt att använda ASP-liknande taggar som <% %> som komplement till de vanliga <?php ?>-taggarna. Det inkluderar kortkommandot för utskrift av variabler: <%= $value %>. För mer information, se Växla från HTML.
Not: Stöd för ASP-liknande taggar lades till i version 3.0.4.
Antalet signifikanta siffror visade av flyttal.
Enforce year 2000 compliance (will cause problems with non-compliant browsers)
Whether to enable the ability to force arguments to be passed by reference at function call time. This method is deprecated and is likely to be unsupported in future versions of PHP/Zend. The encouraged method of specifying which arguments should be passed by reference is in the function declaration. You're encouraged to try and turn this option Off and make sure your scripts work properly with it in order to ensure they will work with future versions of the language (you will receive a warning each time you use this feature, and the argument will be passed by value instead of by reference).
See also References Explained.
Decides whether PHP may expose the fact that it is installed on the server (e.g. by adding its signature to the Web server header). It is no security threat in any way, but it makes it possible to determine whether you use PHP on your server or not.
Here is a short explanation of the configuration directives.
Detta sätter hur mycket minne i bytes som ett script maximalt tillåts allokera. Direktivet förebygger att dåligt skrivna script äter upp allt minne på severn. In order to use this directive you must have enabled it at compile time. So, your configure line would have included: --enable-memory-limit. Note that you have to set it to -1 if you don't want any limit for your memory.
See also: max_execution_time.
Tabell 4-5. Data Handling Configuration Options
Name | Default | Changeable |
---|---|---|
track-vars | "On" | PHP_INI_?? |
arg_separator.output | "&" | PHP_INI_ALL |
arg_separator.input | "&" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
variables_order | "EGPCS" | PHP_INI_ALL |
register_globals | "Off" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
register_argc_argv | "On" | PHP_INI_PERDIR|PHP_INI_SYSTEM |
post_max_size | "8M" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
gpc_order | "GPC" | PHP_INI_ALL |
auto_prepend_file | "" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
auto_append_file | "" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
default_mimetype | "text/html" | PHP_INI_ALL |
default_charset | "iso-8859-1" | PHP_INI_ALL |
always_populate_raw_post_data | "0" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
allow_webdav_methods | "0" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
Here is a short explanation of the configuration directives.
If enabled, then Environment, GET, POST, Cookie, and Server variables can be found in the global associative arrays $_ENV, $_GET, $_POST, $_COOKIE, and $_SERVER.
Note that as of PHP 4.0.3, track_vars is always turned on.
The separator used in PHP generated URLs to separate arguments.
List of separator(s) used by PHP to parse input URLs into variables.
Not: Every character in this directive is considered as separator!
Bestäm ordningen för vilka EGPCS (Environment, GET, POST, Cookie, Server) ska defineras. Standardvärdet för det här direktivet är "EGPCS". Om du t.ex. sätter värdet till "GP" kommer PHP helt att ignorera cookie-, server- och miljö-variabler och skriva över alla GET-värden med POST-värden i de fall då de har samma namn.
Se även register_globals.
Tells whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables. For example; if register_globals = on, the url http://www.example.com/test.php?id=3 will produce $id. Or, $DOCUMENT_ROOT from $_SERVER['DOCUMENT_ROOT']. You may want to turn this off if you don't want to clutter your scripts' global scope with user data. As of PHP 4.2.0, this directive defaults to off. It's preferred to go through PHP Predefined Variables instead, such as the superglobals: $_ENV, $_GET, $_POST, $_COOKIE, and $_SERVER. Please read the security chapter on Using register_globals for related information.
Please note that register_globals cannot be set at runtime (ini_set()). Although, you can use .htaccess if your host allows it as described above. An example .htaccess entry: php_flag register_globals on.
Not: register_globals is affected by the variables_order directive.
Talar om för PHP huruvida det ska deklarera argv- och argc-variablerna (vilka skulle innehålla GET-information).
Se även kommandorad. Det här direktivet kom i och med PHP 4.0.0 och var alltid påslaget i tidigare versioner.
Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize.
If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.
Bestäm ordningen för vilken GET/POST/COOKIE-variabler ska defineras. Standardvärdet för det här direktivet är "GPC". Om du t.ex. sätter värdet till "GP" kommer PHP helt att ignorera cookies samt skriva över alla GET-värden med POST-värden i de fall då de har samma namn.
Not: Notera att det direktivet är inte tillgängligt i PHP 4. Använd variables_order istället.
Specificerar namnet på en fil som inkluderas direkt före huvudfilen. Filen inkluderas på samma sätt som om den hade inkluderats med funktionen include(), vilket betyder att include_path används.
Specialvärdet none stänger av den här funktionen.
Specificerar namnet på en fil som inkluderas direkt efter huvudfilen. Filen inkluderas på samma sätt som om den hade inkluderats med funktionen include(), vilket betyder att include_path används.
Specialvärdet none stänger av den här funktionen.
Not: Om scriptet termineras med hjälp av exit(), kommer filen inte att inkluderas.
As of 4.0b4, PHP always outputs a character encoding by default in the Content-type: header. To disable sending of the charset, simply set it to be empty.
Always populate the $HTTP_RAW_POST_DATA variable.
Allow handling of WebDAV http requests within PHP scripts (eg. PROPFIND, PROPPATCH, MOVE, COPY, etc..) If you want to get the post data of those requests, you have to set always_populate_raw_post_data as well.
See also: magic_quotes_gpc, magic-quotes-runtime, and magic_quotes_sybase.
Tabell 4-6. Paths and Directories Configuration Options
Name | Default | Changeable |
---|---|---|
include_path | PHP_INCLUDE_PATH | PHP_INI_ALL |
doc_root | PHP_INCLUDE_PATH | PHP_INI_SYSTEM |
user_dir | NULL | PHP_INI_SYSTEM |
extension_dir | PHP_EXTENSION_DIR | PHP_INI_SYSTEM |
cgi.force_redirect | "1" | PHP_INI_SYSTEM |
cgi.redirect_status_env | "" | PHP_INI_SYSTEM |
fastcgi.impersonate | "0" | PHP_INI_SYSTEM |
Here is a short explanation of the configuration directives.
Specificerar en lista över kataloger där funktionerna require(), include() och fopen_with_path() ska leta efter filer. Formatet är detsamma som operativsystemets PATH-miljövariabel: listan separeras med kolon under UNIX och med semikolon under Windows.
Standardvärdet för det här direktivet är . (bara nuvarande katalog).
PHP's "rotkatalog" på servern. Används bara om den inte är tom. Om s k safe mode är aktivt kan inga filer utanför den här katalogen kommas åt. If PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root if you are running php as a CGI under any web server (other than IIS) The alternative is to use the cgi.force_redirect configuration below.
The base name of the directory used on a user's home directory for PHP files, for example public_html.
In what directory PHP should look for dynamically loadable extensions. See also: enable_dl, and dl().
Which dynamically loadable extensions to load when PHP starts up.
cgi.force_redirect is necessary to provide security running PHP as a CGI under most web servers. Left undefined, PHP turns this on by default. You can turn it off AT YOUR OWN RISK.
Not: Windows Users: You CAN safely turn this off for IIS, in fact, you MUST. To get OmniHTTPD or Xitami to work you MUST turn it off.
If cgi.force_redirect is turned on, and you are not running under Apache or Netscape (iPlanet) web servers, you MAY need to set an environment variable name that PHP will look for to know it is OK to continue execution.
Not: Setting this variable MAY cause security issues, KNOW WHAT YOU ARE DOING FIRST.
FastCGI under IIS (on WINNT based OS) supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under. mod_fastcgi under Apache does not currently support this feature (03/17/2002) Set to 1 if running under IIS. Default is zero.
Tabell 4-7. File Uploads Configuration Options
Name | Default | Changeable |
---|---|---|
file_uploads | "1" | PHP_INI_SYSTEM |
upload_tmp_dir | NULL | PHP_INI_SYSTEM |
upload_max_filesize | "2M" | PHP_INI_SYSTEM|PHP_INI_PERDIR |
Here is a short explanation of the configuration directives.
Huruvida du vill tillåta filuppladdning via HTTP eller inte. Se även upload_max_filesize-, upload_tmp_dir- och post_max_size-direktiven.
The temporary directory used for storing files when doing file upload. Must be writable by whatever user PHP is running as. If not specified PHP will use the system's default.
The maximum size of an uploaded file.
Föregående | Hem | Nästa |
How to change configuration settings | Upp | Språkreferens |