PHP Parser啟動時會去讀php3.ini. Server module 的PHP則在伺服器啟動時就讀入該檔. CGI型態的PHP則在每次被呼叫時讀取該檔.
以下所列之 directive 與 Apache httpd.conf 的 directive都有對應的關係,只需在以下directive names前加上php3_ 即可.
您可使用phpinfo() 的輸出結果得知大部份的PHP設定狀況.
指定一個在會被自動加入到檔尾並執行的檔案,就像用 include() function一樣,string只是檔名,所以要有 include_path指定該檔所在位置.
一個特殊值none取消auto-appending功能.
註:如果程式本身是以 exit()結束的話則 auto-append 將 不會起作用.
設定是否要讓錯誤訊息以HTML格式輸出到畫面上.
PHP的 root directory),只有在string有值時才有效. 如果PHP是被設定成safe mode, 在這目錄以外的PHP檔將不允許被執行
這對Apache module的PHP很有用,您可以在不同的目錄或虛擬主機開啟或關閉 PHP的執行權限,只要把php3_engine off 加到httpd.conf的正確位置就行了.
記錄錯誤訊息的log檔名,如果是syslog, 則會記錄在系統的log檔案中.UNIX上是指syslog(3),在Windows NT則是指 事件記錄(event log).這功能在Windows 95上是無效的.
設定錯誤報告的等級,由一組一bit的整數參數來區分您所要設的水平標準, 您可以把這些整數加起來組合使用.
Table 4-1. 錯誤等級報告 Error Reporting Levels
| bit value | enabled reporting |
|---|---|
| 1 | 正常錯誤(normal errors) |
| 2 | 正常警告(normal warnings) |
| 4 | 直譯錯誤(parser errors) |
| 8 | 非致命性格式警告(non-critical style-related warnings) |
限制PHP在指定目錄的開檔的權限.
如果一個script要開啟一個檔案,比如說 fopen 或 gzopen, 則檔案的位置將先會被驗證是否合法,如果檔在是在指定目錄以外則動作不被允許 就算使用連結(symbolic link)也無法避開這個限制,因為所有的連結檔將會被驗證其實際路徑.
句點(.)這個特殊值指示只能開啟PHP程式 所在目錄中之檔案
預設值為可以開啟所有檔案
設定GET/POST/COOKIE變數傳送之順序. 初始設定為"GPC".如果設成"GP",則PHP將完全忽略cookies而把所有使用 同樣名稱之傳輸變數(假設一個name有用POST及GET同時被送出) 以GET方式傳送.
指定require(), include()和 fopen_with_path()用到時要找出檔案的一串路徑或目錄名稱. 格式就像系統的PATH環境變數: 在UNIX中以冒號(:)隔開這串目錄,Windows上則以分號來區隔(;).
|
Example 4-1. UNIX include_path include_path=.:/home/httpd/php-lib |
|
Example 4-2. Windows include_path include_path=".;c:\www\phplib" |
是否設定把錯誤記錄在伺服器的error log,所以這可以由伺服器設定檔中指定.
設定GPC (Get/Post/Cookie)之magic_quotes狀態, 如果 magic_quotes 是 on 的話, 所有的單引號 ' (single-quote), 雙引號 " (double quote), 反斜線 \ (backslash) 和空字元NUL 將會自動加上反斜線(\, backslash). 假如magic_quotes_sybase也被設為on, 則單引號(',single-quote)將會自動加在 單引號前(而不是反斜線).
如果magic_quotes_runtime被啟動,多數的 functions傳回的值,包含來自資料庫或文字檔將會自動加上反斜線(\,backslash). 如果magic_quotes_sybase也為on,則單引號將會 自動被複製.
如果magic_quotes_sybase是on, 而magic_quotes_gpc或 magic_quotes_runtime也是on的話,則單引號將會自動複製,而不是在單引號 之前加上一個反斜線.
最長的執行時間(以秒為單位),此設定可以避免一些爛程式把伺服器操到無法正常運作.
最大的記憶體使用空間(單位為位元組bytes),避免爛程式把伺服器的記憶體吃光光.
允許PHP使用<? ?>. 如果您要和XML一起使用則必須關閉此功能,使用PHP時要以 <?php ?>括起來.
如果被enable的話,則在global variable ($php_errormsg)中會存放最近一次的錯誤訊息.
如果有設定則 GET, POST 和 cookie 等將各別被存入global associative arrays 中的 $HTTP_GET_VARS, $HTTP_POST_VARS和 $HTTP_COOKIE_VARS.
上載檔案時的暫存目錄,一定要是PHP的執行使用者(如果是Apache modeul PHP則此為 跑Apache的user)有可寫入的權限之目錄
系統使用者的根目錄中允許執行PHP的目錄,如public_html.
如果啟動,則PHP會輸出警訊,當加號( +)被用在字串時. 這使得一些需要重寫的script更容易被找到, 並用回正常的字串連接功能 (.).
DNS name or IP address of the SMTP server PHP under Windows should use for mail sent with the mail() function.
Which "From:" mail address should be used in mail sent from PHP under Windows.
Where the sendmail program can be found, usually /usr/sbin/sendmail or /usr/lib/sendmail configure does an honest attempt of locating this one for you and set a default, but if it fails, you can set it here.
Systems not using sendmail should set this directive to the sendmail wrapper/replacement their mail system offers, if any. For example, Qmail users can normally set it to /var/qmail/bin/sendmail.
Whether to enable PHP's safe mode. Read the Security chapter for more more information.
If PHP is used in safe mode, system() and the other functions executing system programs refuse to start programs that are not in this directory.
DNS name or IP address of host used by the debugger.
Port number used by the debugger.
Whether the debugger is enabled.
This directive is really only useful in the Apache module version of PHP. You can turn dynamic loading of PHP extensions with dl() on and off per virtual server or per directory.
The main reason for turning dynamic loading off is security. With dynamic loading, it's possible to ignore all the safe_mode and open_basedir restrictions.
The default is to allow dynamic loading, except when using safe-mode. In safe-mode, it's always imposible to use dl().
In what directory PHP should look for dynamically loadable extensions.
Which dynamically loadable extensions to load when PHP starts up.
Whether to allow persistent MySQL connections.
The maximum number of persistent MySQL connections per process.
The maximum number of MySQL connections per process, including persistent connections.
Whether to allow persistent mSQL connections.
The maximum number of persistent mSQL connections per process.
The maximum number of mSQL connections per process, including persistent connections.
Whether to allow persistent Postgres connections.
The maximum number of persistent Postgres connections per process.
The maximum number of Postgres connections per process, including persistent connections.
Whether to allow persistent Sybase connections.
The maximum number of persistent Sybase connections per process.
The maximum number of Sybase connections per process, including persistent connections.
Whether to allow persistent Sybase-CT connections. The default is on.
The maximum number of persistent Sybase-CT connections per process. The default is -1 meaning unlimited.
The maximum number of Sybase-CT connections per process, including persistent connections. The default is -1 meaning unlimited.
Server messages with severity greater than or equal to sybct.min_server_severity will be reported as warnings. This value can also be set from a script by calling sybase_min_server_severity(). The default is 10 which reports errors of information severity or greater.
Client library messages with severity greater than or equal to sybct.min_client_severity will be reported as warnings. This value can also be set from a script by calling sybase_min_client_severity(). The default is 10 which effectively disables reporting.
The maximum time in seconds to wait for a connection attempt to succeed before returning failure. Note that if max_execution_time has been exceeded when a connection attempt times out, your script will be terminated before it can take action on failure. The default is one minute.
The maximum time in seconds to wait for a select_db or query operation to succeed before returning failure. Note that if max_execution_time has been exceeded when am operation times out, your script will be terminated before it can take action on failure. The default is no limit.
The name of the host you claim to be connecting from, for display by sp_who. The default is none.
Number of decimal digits for all bcmath functions.
Name of browser capabilities file.
ODBC data source to use if none is specified in odbc_connect() or odbc_pconnect().
User name to use if none is specified in odbc_connect() or odbc_pconnect().
Password to use if none is specified in odbc_connect() or odbc_pconnect().
Whether to allow persistent ODBC connections.
The maximum number of persistent ODBC connections per process.
The maximum number of ODBC connections per process, including persistent connections.