Created
August 21, 2017 05:16
-
-
Save syoboon77/e5df180a6e00b6110d5969f7ef0d57a0 to your computer and use it in GitHub Desktop.
Ubuntuのphp.iniを半自動で編集するsedスクリプト。「まっさらなVPSからFaucet作るまで頑張るトピック」で使用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# このプロジェクトでは、文字コードはUTF-8で開発します | |
# default_charset = "UTF-8" | |
s|^;\?\(default_charset\) \?= \?.*$|\1 = "UTF-8"| | |
# mbstring.language = Japanese | |
s|^;\?\(mbstring.language\) \?= \?.*$|\1 = Japanese| | |
# mbstring.internal_encoding = "UTF-8" | |
s|^;\?\(mbstring.internal_encoding\) \?= \?.*$|\1 = "UTF-8"| | |
# mbstring.http_input = pass | |
s|^;\?\(mbstring.http_input\) \?= \?.*$|\1 = pass| | |
# mbstring.http_output = pass | |
s|^;\?\(mbstring.http_output\) \?= \?.*$|\1 = pass| | |
# mbstring.encoding_translation = Off | |
s|^;\?\(mbstring.encoding_translation\) \?= \?.*$|\1 = Off| | |
# mbstring.detect_order = auto | |
s|^;\?\(mbstring.detect_order\) \?= \?.*$|\1 = auto| | |
# 外部からincludeしてくるのを禁止 | |
# allow_url_include = Off | |
s|^;\?\(allow_url_include\) \?= \?.*$|\1 = Off| | |
# タイムゾーン設定 | |
# date.timezone = "Asia/Tokyo" | |
s|^;\?\(date.timezone\) \?= \?.*$|\1 = "Asia/Tokyo"| | |
# X-Powered-ByをHTTPレスポンスヘッダーに追加しない | |
# expose_php = Off | |
s|^;\?\(expose_php\) \?= \?.*$|\1 = Off| | |
# ファイルのアップロード機能、今のところはOff | |
# file_uploads = Off | |
s|^;\?\(file_uploads\) \?= \?.*$|\1 = Off| | |
# エラーをログに出力する | |
# log_errors = On | |
s|^;\?\(log_errors\) \?= \?.*$|\1 = On| | |
# エラーログ保存場所 | |
# error_log = "/etc/www/php_errors.log" | |
s|^;\?\(error_log\) \?= \?.*$|\1 = "/etc/www/php_errors.log"| | |
# どのエラーをブラウザに表示するか。とりあえず本番用の設定で | |
# error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT | |
s|^;\?\(error_reporting\) \?= \?.*$|\1 = E_ALL \& ~E_DEPRECATED \& ~E_STRICT| | |
# エラーをブラウザに表示しない(本番用) | |
# display_errors = Off | |
s|^;\?\(display_errors\) \?= \?.*$|\1 = Off| | |
# ここに書かれた関数は使用できなくなる。本来はデフォルト値に追記だが、面倒なので上書きする | |
# disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,eval,system,exec,passthru,popen, | |
s|^;\?\(disable_functions\) \?= \?.*$|\1 = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,eval,system,exec,passthru,popen,| | |
# PHPの拡張機能を動的にロードする機能。Offにしておく | |
# enable_dl = Off | |
s|^;\?\(enable_dl\) \?= \?.*$|\1 = Off| | |
# PHPスクリプトの最大実行時間(秒) | |
# max_execution_time = 60 | |
s|^;\?\(max_execution_time\) \?= \?.*$|\1 = 60| | |
# max_input_time = 60 | |
s|^;\?\(max_input_time\) \?= \?.*$|\1 = 60| | |
# セッションIDにSHA-1を使用 | |
# session.hash_function = 1 | |
s|^;\?\(session.hash_function\) \?= \?.*$|\1 = 1| | |
# セッションID管理にクッキーを使用する | |
# session.use_cookies = 1 | |
s|^;\?\(session.use_cookies\) \?= \?.*$|\1 = 1| | |
# 上記の管理にクッキーのみを使用する | |
# session.use_only_cookies = 1 | |
s|^;\?\(session.use_only_cookies\) \?= \?.*$|\1 = 1| | |
# セッションのクッキーをHTTP通信以外で読み書きさせない | |
# session.cookie_httponly = On | |
s|^;\?\(session.cookie_httponly\) \?= \?.*$|\1 = On| | |
# クッキーの有効期限はブラウザを閉じるまで有効 | |
# session.cookie_lifetime = 0 | |
s|^;\?\(session.cookie_lifetime\) \?= \?.*$|\1 = 0| | |
# session.use_trans_sid = 0 | |
s|^;\?\(session.use_trans_sid\) \?= \?.*$|\1 = 0| | |
# session.auto_start = 0 | |
s|^;\?\(session.auto_start\) \?= \?.*$|\1 = 0| | |
# 古いセッションデータがゴミになるまでの時間(秒) | |
# session.gc_maxlifetime = 1440 | |
s|^;\?\(session.gc_maxlifetime\) \?= \?.*$|\1 = 1440| | |
# 上記のゴミが100分の1の確率で削除される | |
# session.gc_divisor = 100 | |
s|^;\?\(session.gc_divisor\) \?= \?.*$|\1 = 100| | |
# 同上 | |
# session.gc_probability = 1 | |
s|^;\?\(session.gc_probability\) \?= \?.*$|\1 = 1| | |
# session.entropy_file = /dev/urandom | |
s|^;\?\(session.entropy_file\) \?= \?.*$|\1 = /dev/urandom| | |
# session.entropy_length = 32 | |
s|^;\?\(session.entropy_length\) \?= \?.*$|\1 = 32| | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment