Contents

1. 1Gserverとは

1.1 1Gserverについて

1Gserverは、低価格でPHPを使うことができるホスティングサービスです。
サーバはFedora Coreでホスティングされており、PHPやRubyなどを使うことができます。

1.2 1GserverのPHP

1Gserverでは、PHPが使えます。ただし、サーバによりモジュール版が使えるか、CGI版が使えるかの違いがあります。

このWebサイトではCGI版のPHPが使えます。CGI版では、ディレクトリ上にphp.iniを設定することでPHPの設定を変更できます。

2. PHPの設定

2.1 phpを使う

1GserverはPHPのCGI版が動かしています。phpプログラムを使うためには、phpを使うディレクトリにphp.iniを設定する必要があります。

またセキュリティのために、phpを動作するディレクトリのパーミッションを"0755"に、phpファイルのパーミッションを"0644"にする必要があります。

2.2 php.iniを設定する

1Gserverでは、/www以下にWebサイトを構築します。phpを動かすときにはphpプログラムがあるディレクトリにphp.iniファイルを作成します。

以下のようにphp.iniを設定します。

php.ini
; This File for Custmized PHP for aglabo.com
; written by atsushifx <webmaster@aglabo.com>
; $Date: 2008-10-05 23:15:11 +0900 (日, 05 10月 2008) $

[PHP]
short_open_tag = Off
;

;
; Safe Mode
;
safe_mode = On

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
error_reporting  =  E_ALL

display_errors = Off

log_errors = On
error_log = /logs/phperror.log

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
;
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3

register_globals = Off


; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

;
; PHP's built-in default is text/html
default_mimetype = "text/html"
default_charset = "utf-8"




;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;


[MySQL]


[Session]


[Assertion]
; Assert(expr); active by default.
;assert.active = On

; Issue a PHP warning for each failed assertion.
;assert.warning = On

; Don't bail out by default.
;assert.bail = Off

; User-function to be called if an assertion fails.
;assert.callback = 0

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0

[iconv]
iconv.input_encoding = UTF-8
iconv.internal_encoding = UTF-8
iconv.output_encoding = UTF-8



[mbstring]
; language for internal character representation.
mbstring.language = Japanese

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
mbstring.internal_encoding = UTF-8
mbstring.script_encoding = UTF-8

; http input encoding.
mbstring.http_input = pass

; http output encoding. mb_output_handler must be
; registered as output buffer to function
mbstring.http_output = pass

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
;       portable libs/applications.
mbstring.encoding_translation = Off

; automatic encoding detection order.
; auto means
mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
mbstring.substitute_character = none;

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0


; Local Variables:
; tab-width: 4
; End:

以上で、phpの設定は終了です。なお、この設定ファイルはArchivesからダウンロードできます。