Tuesday, January 23, 2007

Catatan Pada php.ini

Berikut ini adalah sedikit catatan pada php.ini yang saya peroleh ketika mencoba menyiapkan sebuah http daemon.

1. Ketika akan menggunakan tanda pembuka code buka kurung lancip '<' dan tanda tanya '?' alih-alih buka kurung lancip '<' dan tanda tanya '?' dan php [*ternyata blogspot tidak membolehkan tag pada input posting :) ], pastikan untuk membuka variabel short_open_tag
.
.
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
.
.
; Allow the tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
.
.

2. Ketika menggunakan variabel global, pastikan untuk membuka variabel register_long_arrays dan register_arc_arv agar anda dapat memakai variabel array gaya lama (misal $HTTP_*_VARS dll
.
.
;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
.
.
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On

; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = On

; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don't use these variables, you
; should turn it off for increased performance.
register_argc_argv = On
.
.

3. Untuk server yang digunakan untuk pengembangan sistem sebaiknya semua error message dibuka agar diketahui semua kesalahan yang mungkin terjadi
.
.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

.
.
error_reporting = E_ALL

; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On
.
.
; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for production boxes.
html_errors = On
.
.

4. Jika ingin menggunakan ASP, maka variabel asp_tags harus dibuka terlebih dahulu
.
.
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
.
.
; Allow ASP-style <% %> tags.
asp_tags = Off
.
.

5. Pastikan untuk me-restart http daemon agar perubahan yang telah dilakukan terhadap php.ini bisa dieksekusi.