text
stringlengths 1
254
| output
stringlengths 2
255
|
---|---|
So, you can use $_SERVER[ 'REMOTE_USER'].
|
設定上の注意 PHP は、外部認証が動作しているかどうかの判定を AuthType ディレクティブの有無で行います。 PHP認証を使用するコンテキストについてこのディレクティブを避けるよ うにして下さい。(さもないと、各認証は失敗します。)
|
PHP uses the presence of an AuthType directive to determine whether external authentication is in effect.
|
しかし、上記の機能も、認証を要求されないURLを管理する人が同じサーバー にある認証を要するURLからパスワードを盗むことを防ぐわけではありませ ん。
|
Both Netscape Navigator and Internet Explorer will clear the local browser window 's authentication cache for the realm upon receiving a server response of 401.
|
サーバーからリターンコード401を受けた際に、Netscape Navigatorおよび Internet Explorerは共にローカルブラウザのウインドウ上の認証キャッシュ を消去します。この機能により、簡単にユーザーを"ログアウト"させ、強 制的にユーザー名とパスワードを再入力させることができます。この機能 は、"タイムアウト"付きのログインや、"ログアウト"ボタンに適用されて います。
|
Some people use this to "time out" logins, or provide a "log-out "button.
|
例 16-2新規に名前/パスワードを入力させるHTTP 認証の例
|
Testing with Lynx has shown that Lynx does not clear the authentication credentials with a 401 server response, so pressing back and then forward again will open the resource as long as the credential requirements haven 't changed.
|
MicrosoftのIISサーバーとCGI版のPHPの組み合わせでは、この機能は、IIS の制約により使用することができないということにも注意して下さい。
|
Also note that this does not work using Microsoft 's IIS server and the CGI version of PHP due to a limitation of IIS.
|
注意 セーフモード が有効の場合、 WWW-Authenticate ヘッダの realm 部にスクリプトのuidが追加されます。
|
When a persistent connection is requested, PHP checks if there' s already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it.
|
持続的接続は、スクリプトの実行終了時にも閉じられないSQLリンクです。 持続的接続が要求された時、PHPは(前もってオープンされたままになって いる)同じ持続的接続が既にオープンされていないかどうかを確認します。 そして、存在する場合には、それを使用します。存在しない場合には、そ のリンクを作成します。'同じ'接続とは、同じホスト、同じユーザー名、 同じパスワード(利用可能な場合)でオープンされた接続のことを意味しま す。
|
People who aren' t thoroughly familiar with the way web servers work and distribute the load may mistake persistent connects for what they're not.
|
注意 IMAP拡張モジュール のように、 持続的接続を提供する拡張モジュールは他にもあります。
|
In fact, to be extremely clear about the subject, persistent connections don' t give you any functionality that wasn't possible with their non-persistent brothers.
|
Webサーバーの動作及び負荷の分散に関して熟知していない人は、持続的接 続において何が行われないかに関してミスを犯す可能性があります。特に、 持続的接続は、同じSQLリンクで'ユーザーセッション'をオープンする機能 やトランザクションを効率的に確立する機能やその他のあらゆる機能を提 供しません。つまり、言いたいことを極めて簡単に述べると、持続的接続 は非持続的接続で使用できない いかなる 機能も提 供しません。
|
Because it is destroyed after every request, any resources that it acquires (such as a link to an SQL database server) are closed when it is destroyed.
|
なぜ?
|
The second, and most popular, method is to run PHP as a module in a multiprocess web server, which currently only includes Apache.
|
これは、Webサーバーの動作により行われるべきものです。Webページを生 成するためにPHPを利用するWebサーバーには、3種類の方法があります。
|
When each request comes in from a client, it is handed off to one of the children that is not already serving another client.
|
最初は、CGI "ラッパー"としてPHPを使用する方法です。このように実行し た場合、PHPインタプリタのインスタンスは、Webサーバーに(PHPページに 関する)ページがリクエストされる度に生成され、破棄されます。リクエス ト毎に破棄されるために、(SQLデータベースサーバーへのリンクのような) 必要な全てのリソースは破棄される際にクローズされます。この場合、持 続的接続を使用することから得るものは何もありません。持続的接続は持 続しないのです。
|
The bottom line is that if that connection overhead is high, persistent connections help you considerably.
|
持続的接続が機能を全く付加しないとしたら、優れている点はなんでしょ う?
|
Another is that when using transactions, a transaction block will also carry over to the next script which uses that connection if script execution ends before the transaction block does.
|
重要なことをまとめます。持続的接続は、標準的な接続に1対1の割りつけ を行うように設計されています。このことは、 常に 持続的接続を非持続的接続で置きかえ、かつ動作を変更しないということ ができることを意味します。持続的接続は、スクリプトの効率を変更する でしょうが、動作は変更しません!
|
Better yet, avoid the problem entirely by not using persistent connections in scripts which use table locks or transactions (you can still use them elsewhere).
|
fbsql_pconnect(), ibase_pconnect(), ifx_pconnect(), imap_popen(), ingres_pconnect(), msql_pconnect(), mssql_pconnect(), mysql_pconnect(), OCIPLogon(), odbc_pconnect(), Ora_pLogon(), pfsockopen(), pg_pconnect(), sybase_pconnect() も参照してください。
|
As long as allow_url_fopen is enabled in php.ini, you can use HTTP and FTP URLs with most of the functions that take a filename as a parameter.
|
php.iniで allow_url_fopen を有効にした場合、 パラメータとしてファイル名をとる関数の多くでHTTPおよびFTPのURL を使用することができます。加えて、 include(), include_once(), require(), require_once() 命令でURLを使用することができます。
|
See Appendix I for more information about the protocols supported by PHP.
|
注意 PHP 4.0.3以前のバージョンにおいては、URLラッパーを使用するために、 configureオプション --enable-url-fopen-wrapper を使用してPHPをconfigureを行なう必要があります。
|
In PHP 4.0.3 and older, in order to use URL wrappers, you were required to configure PHP using the configure option --enable-url-fopen-wrapper.
|
注意 Windows上では、リモートファイルに include() および require() 文を使用することはできません。
|
For example, you can use this to open a file on a remote web server, parse the output for the data you want, and then use that data in a database query, or simply to output it in a style matching the rest of your website.
|
例えば、リモートWebサーバーにファイルをオープンし、データを出力、デー タベースクエリーに使用するか、単にWebサイトのスタイルに合わせて出力 を行うことが可能です。
|
Getting the title of a remote page
|
例 19-1リモートページのタイトルを得る
|
You can also write to files on an FTP server (provided that you have connected as a user with the correct access rights).
|
(正しいアクセス権限を有するユーザとして接続した場合には) FTPサーバにファイルを書き込むこともできます。 この方法では、新規ファイルを作成することのみができます。 既存のファイルを上書きしようとした場合には、 fopen() の処理は失敗します。
|
Storing data on a remote server
|
例 19-2リモートサーバーにデータを保存する
|
Unfortunately that would not work because the fopen() call will fail if the remote file already exists.
|
注意 上の例からリモートログに書きこむためにこの手法を使用することを考えるかも しれません。 Unfortunately that would not work because the fopen() call will fail if the remote file already exists. 分散ロギングのようなことを行うには、 syslog() の使用を考えてみて下さい。
|
Checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed. (note: only affected since PHP 4.2.1)
|
safe-mode により制限される 関数のリストを示します。ただし、まだ、不完全で、不正確である可能性 があります。
|
Checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed. (note: only affected since PHP 4.2.1)
|
表 22-2セーフモードで制限される関数
|
It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren' t very realistic, many people, especially ISP's, use safe mode for now.
|
PHPのセーフモードは共有サーバでのセキュリティの問題を解決するための 試みです。この問題をPHPのレベルで解決しようとするのはアーキテクチャ上 正しくありません。しかし、WebサーバやOSレベルでの代替策はあまり現実 てきではないため、多くのユーザ、特にISPではセーフモードが現在使用され ています。
|
Whether to enable PHP 's safe mode.
|
表 22-1セキュリティとセーフモード設定ディレクティブ
|
By default, Safe Mode does a UID compare check when opening files.
|
セーフモードの設定ディレクティブの簡単な説明を以下に示します。
|
Whether to use UID (FALSE) or GID (TRUE) checking upon file access.
|
Whether to enable PHP's safe mode. Read the Security and chapter for more information.
|
As of PHP 4.2.0, this directive can take a semi-colon separated path in a similar fashion to the include_path directive, rather than just a single directory.
|
By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access.
|
This means that "safe_mode_include_dir = / dir / incl" also allows access to "/ dir / include" and "/ dir / incls" if they exist.
|
UID / GID checks are bypassed when including files from this directory and its subdirectories (directory must also be in include_path or full path must including).
|
For example: "safe_mode_include_dir = / dir / incl /"
|
As of PHP 4.2.0, this directive can take a semi-colon separated path in a similar fashion to the include_path directive, rather than just a single directory.
|
Setting certain environment variables may be a potential security breach.
|
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.
|
This directive contains a comma-delimited list of environment variables that the end user won' t be able to change using putenv().
|
注意 If this directive is empty, PHP will let the user modify ANY environment variable!
|
Limit the files that can be opened by PHP to the specified directory-tree, including the file itself.
|
This directive contains a comma-delimited list of environment variables that the end user won't be able to change using putenv(). These variables will be protected even if safe_mode_allowed_env_vars is set to allow to change them.
|
When a script tries to open a file with, for example, fopen or gzopen, the location of the file is checked.
|
Limit the files that can be opened by PHP to the specified directory-tree. This directive is NOT affected by whether Safe Mode is turned On or Off.
|
Under Windows, separate the directories with a semicolon.
|
The special value. indicates that the directory in which the script is stored will be used as base-directory.
|
As an Apache module, open_basedir paths from parent directories are now automatically inherited.
|
Under Windows, separate the directories with a semicolon. On all other systems, separate the directories with a colon. As an Apache module, open_basedir paths from parent directories are now automatically inherited.
|
For example: "open_basedir = / dir / incl /"
|
注意 Support for multiple directories was added in 3.0.7.
|
The default is to allow all files to be opened.
|
The default is to allow all files to be opened.
|
It takes on a comma-dilimited list of function names. disable_functions is not affected by Safe Mode.
|
This directive allows you to disable certain functions for security reasons. It takes on a comma-dilimited list of function names. disable_functions is not affected by Safe Mode.
|
When safe_mode is on, PHP checks to see if the owner of the current script matches the owner of the file to be operated on by a file function.
|
This directive must be set in php.ini For example, you cannot set this in httpd.conf.
|
?php readfile( '/ etc / passwd');?
|
See also: register_globals, display_errors, and log_errors
|
However, there may be environments where a strict UID check is not appropriate and a relaxed GID check is sufficient.
|
セーフモード がonの場合、PHPは、 現在のスクリプトの所有者がファイル関数により処理されているファイル の所有者に一致するかどうかを調べます。例えば、
|
Warning: open_basedir restriction in effect.
|
If instead of safe_mode, you set an open_basedir directory then all file operations will be limited to files under the specified directory For example (Apache httpd.conf example):
|
If the argument number is of type float, the return type is also float, otherwise it is integer (as float usually has a bigger value range than integer).
|
(PHP 3, PHP 4)
|
$abs = abs( -4.2); / / $abs = 4.2; (double / float) $abs2 = abs(5); / / $abs2 = 5; (integer) $abs3 = abs(-5); / / $abs3 = 5; (integer)
|
numberの絶対値を返します。引数numberが float の場合は 帰り値も float となり、その他の場合は、 int を返します。(これは、 float の範囲は、 int よりも広いためです。)
|
Prev
|
(PHP 4 = 4.1.0)
|
Returns the inverse hyperbolic cosine of arg, i.e. the value whose hyperbolic cosine is arg.
|
arg の逆双曲線余弦、すなわち、 双曲線余弦が arg である値を返します。
|
This function is not implemented on Windows platforms.
|
注意 この関数はWindows環境にはまだ実装されていません。
|
Prev
|
acos(), asin() atan() も参照下さい。
|
Prev
|
(PHP 3, PHP 4)
|
Returns the arc cosine of arg in radians. acos() is the complementary function of cos(), which means that a==cos(acos(a)) for every value of a that is within acos() 'range.
|
引数argのアークコサインをラジアンで返します。
|
Prev
|
acosh(), asin(), atan() も参照下さい。
|
(PHP 4)
|
(PHP 4)
|
It escapes \n, \r etc. in C-like style, characters with ASCII code lower than 32 and higher than 126 are converted to octal representation.
|
charlist パラメータに羅列された文字の前にバッ クスラッシュを付けた文字列を返します。この関数は、 \n, \r 等をC言語と同様の手法 によりエスケープします。アスキーコードが32未満または126より大きい文 字は、8進表現に変換されます。
|
They will be converted to \0, \a, \b, \f, \n, \r, \t and \v.
|
エスケープ文字を0, a, b, f, n, r, t, vとする場合には注意して下さい。 これらは、\0, \a, \b, \f, \n, \r, \t, \v に変換されます。PHPでは、 \0 (NULL), \r (復改文字), \n (改行文字), \t (タブ)が定義済みのエ スケープシーケンスですが、C言語では、これら全てが定義済みのエスケー プシーケンスです。
|
charlist like "\0..\37", which would escape all characters with ASCII code between 0 and 31.
|
"\0..\37" のように charlist に範囲を指定可能で す。この場合、アスキーコードが 0 から 31 の範囲の文字は全てエスケー プされます。
|
$escaped = addcslashes( $not_escaped, "\0..\37!@\177..\377");
|
例 1 addcslashes() の例
|
echo addcslashes( 'foo []', 'A..z'); / / output: \f\o\o\ [\] / / All upper and lower-case letters will be escaped / /... but so will the [\ ]^_` and any tabs, line / / feeds, carriage returns, etc.
|
charlist引数の文字の列びを定義する際には、範囲の最初と最後で指定す る文字集合に含まれる文字の種類を把握するようにして下さい。
|
See also stripcslashes(), stripslashes(), htmlspecialchars(), and quotemeta().
|
stripcslashes(), stripslashes(), htmlspecialchars(), quotemeta() も参照下さい。
|
(PHP 3, PHP 4)
|
(PHP 3, PHP 4)
|
These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).
|
データベースへの問い合わせなどに際してクォートされるべき 文字の前にバックスラッシュを挿入した文字列を返します。クォート されるべき文字とは、シングルクォート( '), ダブルクォート( "),バックスラッシュ (\) ,NUL (NULL バイト) です。
|
See also stripslashes(), htmlspecialchars(), and quotemeta().
|
注意 magic_quotes_gpc は デフォルトでOnです。
|
addcslashes
|
stripslashes(), htmlspecialchars(), quotemeta() も参照下さい。
|
(PHP 4 = 4.2.0)
|
(PHP 4 = 4.2.0)
|
Prev
|
See also aggregate_info(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()
|
Prev
|
(PHP 5 CVS only)
|
Will return the aggretaion information for a particular object as an associative array of arrays of methods and properties.
|
Will return the aggretaion information for a particular object as an associative array of arrays of methods and properties. The key for the main array is the name of the aggregated class.
|
Using aggregate_info()
|
例 1Using aggregate_info()
|
See also aggregate(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()
|
See also aggregate(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()
|
(PHP 4 = 4.2.0)
|
(PHP 4 = 4.2.0)
|
The class constructor or methods whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
The class constructor or methods whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
Prev
|
See also aggregate(), aggregate_info(), aggregate_methods(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()
|
(PHP 4 = 4.2.0)
|
(PHP 4 = 4.2.0)
|
The class constructor or methods whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
The class constructor or methods whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
Prev
|
See also aggregate(), aggregate_info(), aggregate_methods(), aggregate_methods_by_list(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()
|
Prev
|
(PHP 4 = 4.2.0)
|
Aggregates all methods defined in a class to an existing object, except for the class constructor, or methods whose names start with an underscore character (_) which are considered private to the aggregated class.
|
Aggregates all methods defined in a class to an existing object, except for the class constructor, or methods whose names start with an underscore character (_) which are considered private to the aggregated class.
|
Prev
|
See also aggregate(), aggregate_info(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), deaggregate()
|
(PHP 4 = 4.2.0)
|
(PHP 4 = 4.2.0)
|
The properties whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
The properties whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
Prev
|
See also aggregate(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_regexp(), aggregate_info(), deaggregate()
|
(PHP 4 = 4.2.0)
|
(PHP 4 = 4.2.0)
|
The properties whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
The properties whose names start with an underscore character (_), which are considered private to the aggregated class, are always excluded.
|
Prev
|
See also aggregate(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties(), aggregate_properties_by_list(), aggregate_info(), deaggregate()
|
Prev
|
(PHP 4 = 4.2.0)
|
Aggregates all properties defined in a class to an existing object, except for properties whose names start with an underscore character (_) which are considered private to the aggregated class.
|
Aggregates all properties defined in a class to an existing object, except for properties whose names start with an underscore character (_) which are considered private to the aggregated class.
|
Prev
|
See also aggregate(), aggregate_methods(), aggregate_methods_by_list(), aggregate_methods_by_regexp(), aggregate_properties_by_list(), aggregate_properties_by_regexp(), aggregate_info(), deaggregate()
|
(PHP 4 = 4.2.0)
|
(PHP 4 = 4.2.0)
|
The key for the main array is the name of the aggregated class.
|
Will return the aggretaion information for a particular object as an associative array of arrays of methods and properties. The key for the main array is the name of the aggregated class.
|
(PHP 4 = 4.0.5)
|
(PHP 4 = 4.0.5)
|
It may be used to terminate a process after a script with high memory consumption has been run as memory will usually only be freed internally but not given back to the operating system.
|
apache_child_terminate() は、カレントのPHPリク エストを実行しているApacheプロセスをリクエスト終了時点で終了しま す。この関数は、メモリ消費量が大きなスクリプトを実行した後プロセ スを使用するために使用することが可能です。これは、メモリは通常内 部的にのみ解放され、オペレーティングシステムに戻されないためです。
|
This feature is also not available on multithreaded versions of apache like the win32 version.
|
exit() も参照下さい。
|
(PHP 3 = 3.0.4, PHP 4)
|
(PHP 3 = 3.0.4, PHP 4)
|
It goes just far enough to obtain all the important information about the given resource and returns this information in a class.
|
この関数は、URIにリクエストの一部を行います。このリクエストは指定した リソースに関する全ての重要な情報を得るのに十分なものです。 この情報はクラスとして返されます。返されるクラスのプロパティは 次のようなものです。
|
status
|
注意 apache_lookup_uri() は、PHPがApacheモジュールとして インストールされている場合のみ動作します。
|
apache_note() is an Apache-specific function which gets and sets values in a request's notes table.
|
(PHP 3 = 3.0.2, PHP 4)
|
If called with two arguments, it sets the value of note note_name to note_value and returns the previous value of note note_name.
|
apache_note() はApache専用の関数であり、 リクエストの notes テーブルから値を得たり、 値を設定します。引数が1つだけ指定されてコールされた場合、 現在の記号の値 note_name が返されます。 引数が2つ指定されてコールされた場合、記号 note_name の値を note_value にセットし、前の記号 note_name の値を返します。
|
(PHP 4 = 4.3.0)
|
(PHP 4 = 4.3.0)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.